This notebook contains all multivariate analyses of zoobenthic community structure using the new, nearly unheard-of modeling methods: packages mvabund, boral.
Again, to make it self-contained, there will be the same repetitive setup/data import/preparation part.
Setup!
Define the working subdirectories.
## print the working directory, just to be on the safe side
paste("You are here: ", getwd())
data.dir <- "data" ## input data files
functions.dir <- "R" ## functions & scripts
save.dir <- "output" ## clean data, output from models & more complex calculations
figures.dir <- "figs" ## plots & figures
Import libraries.
library(here) ## painless relative paths to subdurectories, etc.
library(tidyverse) ## data manipulation, cleaning, aggregation
library(viridis) ## smart & pretty colour schemes
library(mvabund) ## multivariate modeling analyses in ecology
library(boral) ## more multivariate modeling analyses in ecology
Organize some commonly-used ggplot2 modifications into a more convenient (and less repetitive) format. One day, I MUST figure out the proper way to set the theme..
## ggplot settings & things that I keep reusing
# ggplot_theme <- list(
# theme_bw(),
# theme(element_text(family = "Times"))
# )
## always use black-and-white theme
theme_set(theme_bw())
## helper to adjust ggplot text size & avoid repetitions
text_size <- function(text.x = NULL,
text.y = NULL,
title.x = NULL,
title.y = NULL,
legend.text = NULL,
legend.title = NULL,
strip.x = NULL,
strip.y = NULL) {
theme(axis.text.x = element_text(size = text.x),
axis.text.y = element_text(size = text.y),
axis.title.x = element_text(size = title.x),
axis.title.y = element_text(size = title.y),
legend.text = element_text(size = legend.text),
legend.title = element_text(size = legend.title),
strip.text.x = element_text(size = strip.x),
strip.text.y = element_text(size = strip.y)
)
}
## log y/min + 1 transform - useful for species counts/biomass data visualization
log_y_min <- function(y) {
log(y / min(y[y > 0]) + 1)
}
Import zoobenthic abundance data (cleaned and prepared).
zoo.abnd.sand <- read_csv(here(save.dir, "abnd_sand_orig_clean.csv"))
## convert station to factor (better safe than sorry later, when the stations are not plotted in the order I want them)
(zoo.abnd.sand <- zoo.abnd.sand %>%
mutate(station = factor(station, levels = c("Kraimorie", "Chukalya", "Akin", "Sozopol", "Agalina", "Paraskeva")))
)
Remove the all-0 species (= not present in the current dataset).
Maybe also remove the singletons (species appearing only once in the whole dataset and represented by a single individual = so rare that it’s unlikely they carry important information, but it would probably improve the run times).
(zoo.abnd.flt.sand <- zoo.abnd.sand %>%
select(-c(station:replicate)) %>%
select(which(colSums(.) > 0))
)
Perform a model-based unconstrained ordination by fiting a pure latent variable model (package boral - Hui et al., 2014). This will allow to visualize the multivariate stations x species data - similar to nMDS, can be interpreted in the same way.
I’m including a (fixed) row effect to account for differences in site total abundance - this way, the ordination is in terms of species composition.
NB this takes about a million years to run!
lvm.sand <- boral(y = zoo.abnd.flt.sand,
family = "negative.binomial",
## we want to control for site effects - there are 6 sites with 9 replicates each
row.eff = "fixed", row.ids = matrix(rep(1:6, each = 9), ncol = 1),
## 2 latent variables = 2 axes on which to represent the zoobenthic data
lv.control = list(num.lv = 2)
# ## example control structure, to check if function does what I want, because otherwise it takes an intolerably long time, and I'll shoot myself if I have to wait for it again
# mcmc.control = list(n.burnin = 10, n.iteration = 100,
# n.thin = 1)
#
)
Check the summary and diagnostic plots for the LVM.
plot(lvm.sand)
NULL
The residuals plots look fine (no patterns in the residuals vs fitted, so variance is homogeneous, the quantile plot shows a normal distribution of the residuals) - the model fits the data pretty well.
Save the sand LVM.
write_rds(lvm.sand,
here(save.dir, "lvm_sand.RDS"))
Examine the biplot obtained by fitting the LVM, as well as the 20 most “important” species.
lvsplot(lvm.sand, jitter = T, biplot = TRUE, ind.spp = 20)
Only the first 20 ``most important'' latent variable coefficients included in biplot
All in all, the final result resembles the nMDS ordination very much - same 4 clusters (Kraimorie + Chukalya, AKin, Agalina, Sozopol + Paraskeva). Kraimorie and Chukalya are better distinguished on the LVM plot than on the MDS, but still.
The run time is extremely, extremely long (~1h), but the data don’t need to be transformed, and the model fit can be examined and adjusted if necessary.
The species singled out as significant are probably somewhat different - have to check!
Redo the biplot, because this one is not very pretty. I’m not adding the species on top, first because I’m too lazy to figure out the procedure for ordering them, and second because the plot gets too busy.
Make the plot and save it.
## save the LVM plot for the sand stations
ggsave(file = here(figures.dir, "lvm_sand.png"),
plot.lvm.sand,
width = 15, units = "cm", dpi = 300)
Let’s fit GLMs to the sites x species matrix to try and explain the observed differences in community structure by the variation of the environmental parameters.
These functions all come from package mvabund.
Import the environmental data - the one cleaned, prepared and saved in the previous notebook (classical multivariate methods). It contains long-term averages for the water column data (2009-2011 + 2013-2014) at each station, repeated for each replicate, and the sediment data (2013-2014), again repeated to the same number of replicates. Only the variables determined to be significant by PCA are kept.
env.sand <- read_csv(here(save.dir, "env_data_ordinations_sand.csv"))
## convert station to factor
(env.sand <- env.sand %>%
mutate(station = factor(station,
levels = c("Kraimorie", "Chukalya", "Akin", "Sozopol", "Agalina", "Paraskeva")))
)
Station is a factor, the rest of the variables are numeric.
Turn the zoobenthic data (minus the all-0 taxa) into a matrix - easier for the mvabund package and methods to deal with.
## there is already one subset of filtered count data (54 x 147) - use it
zoo.mvabnd.sand <- mvabund(zoo.abnd.flt.sand)
First, let’s see if the groups from the latent variable model (more or less equal to the clusters from the classical ordination) are valid, and which species exhibit a response.
## construct the vector of the clusters by hand, it's easier that way..
lvm.clusters.sand <- c(rep(1, times = 18), rep(2:4, each = 9), rep(3, times = 9))
## convert to factor
(lvm.clusters.sand <- factor(lvm.clusters.sand))
Check the model assumptions. 1. Mean-variance assumption => determines the choice of family parameter. Can be checked by plotting residuals vs fits: if little pattern - the chosen mean-variance assumption is plausible.
Another way: direct plotting (variance ~ mean), for each species within each factor level.
plot(manyglm(zoo.mvabnd.sand ~ lvm.clusters.sand, family = "negative.binomial"))
meanvar.plot(zoo.mvabnd.sand ~ lvm.clusters.sand, table = TRUE)
START SECTION 2
Plotting if overlay is TRUE
using grouping variable lvm.clusters.sand 290 mean values were 0 and could
not be included in the log-plot
using grouping variable lvm.clusters.sand 290 variance values were 0 and could not
be included in the log-plot
FINISHED SECTION 2
$mean
Chamelea.gallina Protodorvillea.kefersteini Oligochaeta Microdeutopus.versiculatus
1 5.0555556 22.7222222 29.2222222 0.1666667
2 10.1111111 190.5555556 187.0000000 0.0000000
3 140.3888889 0.8333333 0.2222222 0.0000000
4 0.3333333 60.2222222 20.2222222 136.5555556
Heteromastus.filiformis Melinna.palmata Prionospio.cirrifera Lentidium.mediterraneum
1 62.72222222 51.55555556 26.0000000 0.00000
2 0.00000000 0.00000000 3.0000000 0.00000
3 0.05555556 0.05555556 0.3333333 21.77778
4 0.22222222 0.00000000 0.0000000 0.00000
Eurydice.dollfusi Polygordius.neapolitanus Branchiostoma.lanceolatum Ampelisca.diadema
1 0.0000000 1.333333 0.0000000 9.944444
2 6.5555556 8.444444 23.1111111 6.666667
3 0.7777778 0.000000 0.5555556 2.111111
4 34.7777778 22.888889 9.5555556 1.333333
Melita.palmata Bittium.reticulatum Capitella.minima Nemertea Micronephthys.stammeri
1 0.00000 9.7222222 6.4444444 2.222222 3.944444
2 0.00000 3.8888889 0.1111111 3.555556 0.000000
3 0.00000 1.0555556 2.6666667 2.055556 3.277778
4 31.77778 0.8888889 2.1111111 6.666667 3.222222
Pseudocuma.longicorne Polycirrus.caliendrum Sphaerosyllis.hystrix
1 0.0000000 0.00000 1.0000000
2 3.3333333 0.00000 2.7777778
3 7.0000000 0.00000 0.2222222
4 0.1111111 17.22222 11.1111111
Monocorophium.acherusicum Polycirrus.jubatus Ophelia.limacina Spio.filicornis
1 4.9444444 0.00000 0.0000000 0.05555556
2 0.7777778 0.00000 12.3333333 0.00000000
3 0.1111111 0.00000 0.1111111 7.11111111
4 5.3333333 14.88889 2.2222222 0.00000000
Hirudinea Lindrilus.flavocapitatus Polydora.ciliata Streptosyllis.bidentata
1 0.05555556 0.2222222 6.7222222 0.00000
2 4.11111111 13.6666667 0.0000000 0.00000
3 0.00000000 0.0000000 0.1111111 0.00000
4 9.88888889 0.0000000 0.0000000 13.66667
Acari Anadara.kagoshimensis Abra.alba Parvicardium.exiguum Exogone.naidina
1 0.05555556 5.666667 3.0000000 4.0000000 1.2777778
2 0.33333333 0.000000 0.4444444 0.3333333 0.6666667
3 0.00000000 0.000000 2.3888889 0.9444444 1.2222222
4 11.88888889 0.000000 0.0000000 0.5555556 4.5555556
Nototropis.guttatus Microphthalmus.fragilis Lagis.koreni Nephtys.cirrosa
1 0.4444444 0.000000 4.2222222 1.0000000
2 4.7777778 6.333333 0.1111111 0.0000000
3 0.6111111 0.000000 0.0000000 3.1111111
4 2.3333333 2.777778 0.2222222 0.2222222
Lucinella.divaricata Perioculodes.longimanus Bathyporeia.guilliamsoniana
1 0.000000 2.1666667 0.0000000
2 0.000000 1.3333333 4.7777778
3 3.666667 0.5555556 1.1111111
4 0.000000 0.5555556 0.1111111
Glycera.tridactyla Tellina.tenuis Aonides.paucibranchiata Caecum.armoricum
1 2.7222222 0.5000000 2.8333333 0.0000000
2 0.0000000 0.5555556 0.0000000 0.2222222
3 0.7777778 2.3333333 0.0000000 0.0000000
4 0.1111111 0.0000000 0.4444444 5.7777778
Bodotria.arenosa Spisula.subtruncata Harmothoe.reticulata Eunice.vittata Turbellaria
1 0.3333333 0.05555556 1.888889 0.1666667 1.1111111
2 1.4444444 0.00000000 0.000000 0.0000000 0.4444444
3 0.0000000 2.72222222 0.000000 0.0000000 0.3888889
4 3.5555556 0.00000000 1.555556 4.4444444 1.0000000
Diogenes.pugilator Loripes.orbiculatus Mytilaster.lineatus Genetyllis.tuberculata
1 0.9444444 0.05555556 1.0555556 0.1111111
2 0.7777778 0.00000000 1.0000000 0.0000000
3 0.5555556 2.00000000 0.3333333 0.5000000
4 0.4444444 0.00000000 0.3333333 2.7777778
Iphinoe.tenella Dinophilus.gyrociliatus Perinereis.cultrifera Pitar.rudis
1 1.888889 0.27777778 0.05555556 1.2222222
2 0.000000 0.00000000 0.33333333 0.0000000
3 0.000000 0.05555556 0.27777778 0.0000000
4 0.000000 3.00000000 2.33333333 0.7777778
Syllis.hyalina Leiochone.leiopygos Salvatoria.clavata Amphibalanus.improvisus
1 0.000000 1.4444444 0.0000000 0.9444444
2 0.000000 0.0000000 0.5555556 0.4444444
3 0.000000 0.0000000 0.0000000 0.2222222
4 3.222222 0.2222222 2.5555556 0.2222222
Capitella.capitata Syllis.gracilis Decapoda.larvae Magelona.papillicornis
1 0.7777778 0.3888889 1.2777778 0.0000000
2 0.2222222 0.0000000 0.1111111 0.1111111
3 0.3888889 0.0000000 0.0000000 1.2222222
4 0.4444444 2.1111111 0.1111111 0.0000000
Tritia.neritea Alitta.succinea Eteone.sp. Schistomeringos.rudolphi Microphthalmus.sp.
1 0.000000 0.50000000 0.2222222 0.00000000 0.0000000
2 0.000000 0.11111111 0.0000000 0.00000000 0.0000000
3 1.222222 0.05555556 0.2222222 0.05555556 0.3888889
4 0.000000 1.11111111 1.4444444 1.88888889 1.0000000
Caecum.trachea Donax.venustus Mysta.picta Glycera.sp. Odostomia.plicata
1 0.0000000 0.0000000 0.1111111 0.6111111 0.1111111
2 0.5555556 0.0000000 0.2222222 0.0000000 0.0000000
3 0.0000000 0.8333333 0.4444444 0.0000000 0.6111111
4 1.1111111 0.0000000 0.3333333 0.3333333 0.0000000
Apseudopsis.ostroumovi Cytharella.costulata Kellia.suborbicularis
1 0.38888889 0.61111111 0.6666667
2 0.00000000 0.00000000 0.0000000
3 0.05555556 0.05555556 0.0000000
4 0.44444444 0.00000000 0.0000000
Leptosynapta.inhaerens Spionidae Tritia.reticulata Gastrosaccus.sanctus
1 0.000000 0.3888889 0.3888889 0.05555556
2 0.000000 0.1111111 0.5555556 0.66666667
3 0.000000 0.0000000 0.0000000 0.22222222
4 1.333333 0.4444444 0.0000000 0.00000000
Micromaldane.ornithochaeta Phoronida Holothuroidea Nereis.perivisceralis
1 0.0000000 0.55555556 0.000000 0
2 0.0000000 0.00000000 0.000000 0
3 0.6111111 0.05555556 0.000000 0
4 0.0000000 0.00000000 1.111111 1
Phyllodoce.sp. Amphitritides.gracilis Gammaridae Amphipoda Harmothoe.imbricata
1 0.11111111 0.0000000 0.00000000 0.0000000 0.3888889
2 0.22222222 0.0000000 0.77777778 0.7777778 0.0000000
3 0.05555556 0.0000000 0.05555556 0.0000000 0.0000000
4 0.44444444 0.8888889 0.00000000 0.0000000 0.0000000
Mytilus.galloprovincialis Pholoe.inornata Pisione.remota Ampithoe.sp.
1 0.05555556 0.0000000 0.05555556 0.0000000
2 0.00000000 0.0000000 0.44444444 0.3333333
3 0.00000000 0.0000000 0.00000000 0.1666667
4 0.66666667 0.7777778 0.22222222 0.0000000
Paradoneis.harpagonea Platyhelminthes Platynereis.dumerilii Rissoa.membranacea
1 0.0000000 0.0000000 0.0000000 0.0000000
2 0.0000000 0.2222222 0.0000000 0.0000000
3 0.3333333 0.0000000 0.0000000 0.3333333
4 0.0000000 0.4444444 0.6666667 0.0000000
Brachynotus.sexdentatus Eulalia.viridis Microdeutopus.gryllotalpa Nereis.pelagica
1 0.2777778 0.05555556 0.1111111 0.0000000
2 0.0000000 0.00000000 0.1111111 0.0000000
3 0.0000000 0.00000000 0.1111111 0.0000000
4 0.0000000 0.44444444 0.0000000 0.5555556
Rapana.venosa Sabellaria.taurica Steromphala.divaricata Aricidea.claudiae
1 0.2777778 0.2777778 0.0000000 0.2222222
2 0.0000000 0.0000000 0.0000000 0.0000000
3 0.0000000 0.0000000 0.0000000 0.0000000
4 0.0000000 0.0000000 0.5555556 0.0000000
Monocorophium.insidiosum Nereis.pulsatoria Parthenina.interstincta Protodrilus.sp.
1 0.0000000 0.16666667 0.05555556 0.0000000
2 0.0000000 0.00000000 0.00000000 0.4444444
3 0.2222222 0.05555556 0.16666667 0.0000000
4 0.0000000 0.00000000 0.00000000 0.0000000
Sternaspis.scutata Tellina.fabula Cerastoderma.edule Chondrochelia.savignyi
1 0.0000000 0.0000000 0.0000000 0.0000000
2 0.4444444 0.0000000 0.0000000 0.0000000
3 0.0000000 0.2222222 0.1666667 0.0000000
4 0.0000000 0.0000000 0.0000000 0.3333333
Crassicorophium.crassicorne Magelona.rosea Polititapes.aureus Polychaeta.larvae
1 0.0000000 0.0000000 0.1666667 0.0000000
2 0.3333333 0.0000000 0.0000000 0.3333333
3 0.0000000 0.1666667 0.0000000 0.0000000
4 0.0000000 0.0000000 0.0000000 0.0000000
Retusa.variabilis Brachystomia.scalaris Eteone.flava Hydrobia.sp. Mactra.stultorum
1 0.0000000 0.0000000 0.0000000 0.00000000 0.0000000
2 0.0000000 0.0000000 0.0000000 0.00000000 0.0000000
3 0.1666667 0.1111111 0.1111111 0.05555556 0.1111111
4 0.0000000 0.0000000 0.0000000 0.11111111 0.0000000
Nephtyidae Papillicardium.papillosum Abra.sp. Acanthocardia.tuberculata Actiniaria
1 0.0000000 0.0000000 0.00000000 0.00000000 0.00000000
2 0.0000000 0.0000000 0.00000000 0.00000000 0.00000000
3 0.1111111 0.1111111 0.05555556 0.05555556 0.05555556
4 0.0000000 0.0000000 0.00000000 0.00000000 0.00000000
Cardiidae Cerastoderma.glaucum Cumopsis.goodsir Elaphognathia.bacescoi
1 0.00000000 0.05555556 0.00000000 0.0000000
2 0.00000000 0.00000000 0.00000000 0.0000000
3 0.05555556 0.00000000 0.05555556 0.0000000
4 0.00000000 0.00000000 0.00000000 0.1111111
Eurydice.pontica Hydrobia.acuta Iphinoe.sp. Lysidice.ninetta Maldanidae
1 0.0000000 0.05555556 0.0000000 0.0000000 0.00000000
2 0.1111111 0.00000000 0.1111111 0.1111111 0.00000000
3 0.0000000 0.00000000 0.0000000 0.0000000 0.05555556
4 0.0000000 0.00000000 0.0000000 0.0000000 0.00000000
Microdeutopus.sp. Neanthes.sp. Nereididae Pestarella.candida Pisces.larvae
1 0.00000000 0.05555556 0.0000000 0.0000000 0.05555556
2 0.00000000 0.00000000 0.1111111 0.0000000 0.00000000
3 0.05555556 0.00000000 0.0000000 0.0000000 0.00000000
4 0.00000000 0.00000000 0.0000000 0.1111111 0.00000000
Retusa.truncatula Rhithropanopeus.harrisii Stenothoe.monoculoides Upogebia.pusilla
1 0.00000000 0.0000000 0.0000000 0.0000000
2 0.00000000 0.0000000 0.0000000 0.0000000
3 0.05555556 0.0000000 0.0000000 0.0000000
4 0.00000000 0.1111111 0.1111111 0.1111111
$var
Chamelea.gallina Protodorvillea.kefersteini Oligochaeta Microdeutopus.versiculatus
1 32.05556 707.0359477 3.339477e+02 0.500
2 38.86111 7209.2777778 3.244850e+04 0.000
3 7120.36928 0.9705882 3.006536e-01 0.000
4 0.25000 2202.9444444 1.089444e+02 8235.778
Heteromastus.filiformis Melinna.palmata Prionospio.cirrifera Lentidium.mediterraneum
1 1.564683e+03 2.225908e+03 339.2941176 0.000
2 0.000000e+00 0.000000e+00 17.7500000 0.000
3 5.555556e-02 5.555556e-02 0.4705882 2097.242
4 4.444444e-01 0.000000e+00 0.0000000 0.000
Eurydice.dollfusi Polygordius.neapolitanus Branchiostoma.lanceolatum Ampelisca.diadema
1 0.000000 10.23529 0.0000000 107.93791
2 46.277778 50.02778 52.8611111 59.50000
3 3.712418 0.00000 0.7320261 7.51634
4 638.944444 68.11111 12.0277778 1.50000
Melita.palmata Bittium.reticulatum Capitella.minima Nemertea Micronephthys.stammeri
1 0.0000 142.447712 48.2614379 4.418301 12.173203
2 0.0000 9.861111 0.1111111 45.777778 0.000000
3 0.0000 1.349673 38.0000000 9.702614 5.388889
4 281.4444 1.611111 5.3611111 62.750000 3.944444
Pseudocuma.longicorne Polycirrus.caliendrum Sphaerosyllis.hystrix
1 0.0000000 0.0000 2.7058824
2 16.0000000 0.0000 8.9444444
3 38.0000000 0.0000 0.5359477
4 0.1111111 323.6944 72.8611111
Monocorophium.acherusicum Polycirrus.jubatus Ophelia.limacina Spio.filicornis
1 17.7026144 0.00000 0.0000000 0.05555556
2 1.4444444 0.00000 42.5000000 0.00000000
3 0.1045752 0.00000 0.1045752 136.81045752
4 26.0000000 64.11111 6.1944444 0.00000000
Hirudinea Lindrilus.flavocapitatus Polydora.ciliata Streptosyllis.bidentata
1 0.05555556 0.8888889 64.5653595 0.00
2 8.11111111 338.2500000 0.0000000 0.00
3 0.00000000 0.0000000 0.1045752 0.00
4 36.61111111 0.0000000 0.0000000 18.75
Acari Anadara.kagoshimensis Abra.alba Parvicardium.exiguum Exogone.naidina
1 0.05555556 10.23529 10.470588 7.0588235 1.506536
2 0.50000000 0.00000 1.777778 0.2500000 0.750000
3 0.00000000 0.00000 6.604575 1.2320261 1.947712
4 69.61111111 0.00000 0.000000 0.5277778 59.277778
Nototropis.guttatus Microphthalmus.fragilis Lagis.koreni Nephtys.cirrosa
1 0.3790850 0.00000 7.3594771 3.2941176
2 8.1944444 33.50000 0.1111111 0.0000000
3 0.8398693 0.00000 0.0000000 6.4575163
4 5.2500000 13.94444 0.1944444 0.4444444
Lucinella.divaricata Perioculodes.longimanus Bathyporeia.guilliamsoniana
1 0.00000 2.8529412 0.0000000
2 0.00000 3.2500000 6.9444444
3 56.23529 0.7320261 1.7516340
4 0.00000 1.7777778 0.1111111
Glycera.tridactyla Tellina.tenuis Aonides.paucibranchiata Caecum.armoricum
1 14.0947712 0.5000000 18.852941 0.0000000
2 0.0000000 0.5277778 0.000000 0.4444444
3 1.8300654 16.5882353 0.000000 0.0000000
4 0.1111111 0.0000000 1.027778 55.9444444
Bodotria.arenosa Spisula.subtruncata Harmothoe.reticulata Eunice.vittata Turbellaria
1 0.7058824 0.05555556 2.928105 0.1470588 4.3398693
2 5.2777778 0.00000000 0.000000 0.0000000 0.5277778
3 0.0000000 6.44771242 0.000000 0.0000000 0.7222222
4 4.5277778 0.00000000 1.277778 13.5277778 1.2500000
Diogenes.pugilator Loripes.orbiculatus Mytilaster.lineatus Genetyllis.tuberculata
1 0.7614379 0.05555556 0.7614379 0.1045752
2 1.1944444 0.00000000 2.0000000 0.0000000
3 0.3790850 9.05882353 0.2352941 0.8529412
4 0.2777778 0.00000000 0.2500000 15.1944444
Iphinoe.tenella Dinophilus.gyrociliatus Perinereis.cultrifera Pitar.rudis
1 3.51634 0.56535948 0.05555556 8.771242
2 0.00000 0.00000000 1.00000000 0.000000
3 0.00000 0.05555556 0.21241830 0.000000
4 0.00000 5.75000000 7.50000000 1.194444
Syllis.hyalina Leiochone.leiopygos Salvatoria.clavata Amphibalanus.improvisus
1 0.000000 2.0261438 0.0000000 0.8790850
2 0.000000 0.0000000 0.7777778 0.5277778
3 0.000000 0.0000000 0.0000000 0.1830065
4 8.444444 0.4444444 11.5277778 0.1944444
Capitella.capitata Syllis.gracilis Decapoda.larvae Magelona.papillicornis
1 1.5947712 0.4869281 14.8006536 0.0000000
2 0.4444444 0.0000000 0.1111111 0.1111111
3 0.3692810 0.0000000 0.0000000 0.8888889
4 0.7777778 2.8611111 0.1111111 0.0000000
Tritia.neritea Alitta.succinea Eteone.sp. Schistomeringos.rudolphi Microphthalmus.sp.
1 0.000000 0.85294118 0.3006536 0.00000000 0.0000000
2 0.000000 0.11111111 0.0000000 0.00000000 0.0000000
3 3.477124 0.05555556 0.3006536 0.05555556 0.7222222
4 0.000000 1.61111111 3.5277778 2.11111111 4.5000000
Caecum.trachea Donax.venustus Mysta.picta Glycera.sp. Odostomia.plicata
1 0.000000 0.000000 0.1045752 1.663399 0.2222222
2 1.777778 0.000000 0.1944444 0.000000 0.0000000
3 0.000000 1.088235 0.6143791 0.000000 1.6633987
4 2.861111 0.000000 0.5000000 0.500000 0.0000000
Apseudopsis.ostroumovi Cytharella.costulata Kellia.suborbicularis
1 0.60457516 0.36928105 1.882353
2 0.00000000 0.00000000 0.000000
3 0.05555556 0.05555556 0.000000
4 1.02777778 0.00000000 0.000000
Leptosynapta.inhaerens Spionidae Tritia.reticulata Gastrosaccus.sanctus
1 0.00 2.7222222 0.369281 0.05555556
2 0.00 0.1111111 1.777778 1.25000000
3 0.00 0.0000000 0.000000 0.30065359
4 8.75 1.0277778 0.000000 0.00000000
Micromaldane.ornithochaeta Phoronida Holothuroidea Nereis.perivisceralis
1 0.000000 0.73202614 0.000000 0.00
2 0.000000 0.00000000 0.000000 0.00
3 1.075163 0.05555556 0.000000 0.00
4 0.000000 0.00000000 1.861111 2.75
Phyllodoce.sp. Amphitritides.gracilis Gammaridae Amphipoda Harmothoe.imbricata
1 0.10457516 0.000000 0.00000000 0.000000 2.01634
2 0.44444444 0.000000 2.94444444 5.444444 0.00000
3 0.05555556 0.000000 0.05555556 0.000000 0.00000
4 0.77777778 4.111111 0.00000000 0.000000 0.00000
Mytilus.galloprovincialis Pholoe.inornata Pisione.remota Ampithoe.sp.
1 0.05555556 0.000000 0.05555556 0.0000000
2 0.00000000 0.000000 0.52777778 1.0000000
3 0.00000000 0.000000 0.00000000 0.2647059
4 4.00000000 3.944444 0.19444444 0.0000000
Paradoneis.harpagonea Platyhelminthes Platynereis.dumerilii Rissoa.membranacea
1 0.0000000 0.0000000 0.00 0.0000000
2 0.0000000 0.1944444 0.00 0.0000000
3 0.5882353 0.0000000 0.00 0.9411765
4 0.0000000 0.2777778 2.75 0.0000000
Brachynotus.sexdentatus Eulalia.viridis Microdeutopus.gryllotalpa Nereis.pelagica
1 0.3300654 0.05555556 0.2222222 0.000000
2 0.0000000 0.00000000 0.1111111 0.000000
3 0.0000000 0.00000000 0.1045752 0.000000
4 0.0000000 1.02777778 0.0000000 2.777778
Rapana.venosa Sabellaria.taurica Steromphala.divaricata Aricidea.claudiae
1 0.3300654 0.3300654 0.0000000 0.5359477
2 0.0000000 0.0000000 0.0000000 0.0000000
3 0.0000000 0.0000000 0.0000000 0.0000000
4 0.0000000 0.0000000 0.7777778 0.0000000
Monocorophium.insidiosum Nereis.pulsatoria Parthenina.interstincta Protodrilus.sp.
1 0.0000000 0.26470588 0.05555556 0.000000
2 0.0000000 0.00000000 0.00000000 1.777778
3 0.5359477 0.05555556 0.14705882 0.000000
4 0.0000000 0.00000000 0.00000000 0.000000
Sternaspis.scutata Tellina.fabula Cerastoderma.edule Chondrochelia.savignyi
1 0.000000 0.0000000 0.0000000 0
2 1.777778 0.0000000 0.0000000 0
3 0.000000 0.4183007 0.2647059 0
4 0.000000 0.0000000 0.0000000 1
Crassicorophium.crassicorne Magelona.rosea Polititapes.aureus Polychaeta.larvae
1 0 0.0000000 0.1470588 0.0
2 1 0.0000000 0.0000000 0.5
3 0 0.1470588 0.0000000 0.0
4 0 0.0000000 0.0000000 0.0
Retusa.variabilis Brachystomia.scalaris Eteone.flava Hydrobia.sp. Mactra.stultorum
1 0.0000000 0.0000000 0.0000000 0.00000000 0.0000000
2 0.0000000 0.0000000 0.0000000 0.00000000 0.0000000
3 0.1470588 0.2222222 0.1045752 0.05555556 0.1045752
4 0.0000000 0.0000000 0.0000000 0.11111111 0.0000000
Nephtyidae Papillicardium.papillosum Abra.sp. Acanthocardia.tuberculata Actiniaria
1 0.0000000 0.0000000 0.00000000 0.00000000 0.00000000
2 0.0000000 0.0000000 0.00000000 0.00000000 0.00000000
3 0.2222222 0.1045752 0.05555556 0.05555556 0.05555556
4 0.0000000 0.0000000 0.00000000 0.00000000 0.00000000
Cardiidae Cerastoderma.glaucum Cumopsis.goodsir Elaphognathia.bacescoi
1 0.00000000 0.05555556 0.00000000 0.0000000
2 0.00000000 0.00000000 0.00000000 0.0000000
3 0.05555556 0.00000000 0.05555556 0.0000000
4 0.00000000 0.00000000 0.00000000 0.1111111
Eurydice.pontica Hydrobia.acuta Iphinoe.sp. Lysidice.ninetta Maldanidae
1 0.0000000 0.05555556 0.0000000 0.0000000 0.00000000
2 0.1111111 0.00000000 0.1111111 0.1111111 0.00000000
3 0.0000000 0.00000000 0.0000000 0.0000000 0.05555556
4 0.0000000 0.00000000 0.0000000 0.0000000 0.00000000
Microdeutopus.sp. Neanthes.sp. Nereididae Pestarella.candida Pisces.larvae
1 0.00000000 0.05555556 0.0000000 0.0000000 0.05555556
2 0.00000000 0.00000000 0.1111111 0.0000000 0.00000000
3 0.05555556 0.00000000 0.0000000 0.0000000 0.00000000
4 0.00000000 0.00000000 0.0000000 0.1111111 0.00000000
Retusa.truncatula Rhithropanopeus.harrisii Stenothoe.monoculoides Upogebia.pusilla
1 0.00000000 0.0000000 0.0000000 0.0000000
2 0.00000000 0.0000000 0.0000000 0.0000000
3 0.05555556 0.0000000 0.0000000 0.0000000
4 0.00000000 0.1111111 0.1111111 0.1111111
It’s not perfect, but it’s not too terrible either.
Everything looks more or less fine; fit the model.
glms.lvm.sand <- manyglm(zoo.mvabnd.sand ~ lvm.clusters.sand,
family = "negative.binomial")
Explore the fit (residuals, diagnostic plots, etc.).
png(filename = here(figures.dir, "diag_pl_sand1.png"), width = 16, height = 10, units = "cm", res = 300)
plot.manyglm(glms.lvm.sand, which = 2)
dev.off()
null device
1
I really don’t like the rainbow palette, but I would like to include these plots in my thesis results.. Will have to do something about it, just not right now.
Save the model!
write_rds(glms.lvm.sand,
here(save.dir, "glms_lvm_sand.RDS"))
Let’s see the model summary (NB takes a LOT of time if there are many resamplings!).
(glms.lvm.sand.summary <- summary(glms.lvm.sand,
test = "LR", p.uni = "adjusted",
nBoot = 999, ## limit the number of permutations if you just want to check it out
show.time = "all")
)
The factor (here - groups outlined by the LVM) is highly significant according to the models.
This also allows us to see which species exhibit a response to the chosen factor. The LR (likelihood ratio) statistic is used as a measure of the strength of individual taxon contributions to the observed patterns. I’ll save the summary for safekeeping, but I’ll also run an anova - to get an analysis of deviance table on the model fit (also better for extracting the species contributions, or at least I know how to do it).
write_rds(glms.lvm.sand.summary,
here(save.dir, "glms_lvm_sand_summary.RDS"))
Run the anova on the model.
(glms.lvm.sand.aov <- anova.manyglm(glms.lvm.sand,
test = "LR", p.uni = "adjusted",
nBoot = 999, ## limit the number of permutations for a shorter run time
show.time = "all")
)
I probably shouldn’t have printed all this out, but oh well who cares.
Save the ANOVA, too.
write_rds(glms.lvm.sand.aov,
here(save.dir, "glms_lvm_sand_anova.RDS"))
NOW let’s get the taxa with the highest contributions to the tested pattern (here - clusters in the LVM, which are really the different soft-bottom habitats).
top_n_sp_glm <- function(glms.aov, tot.dev.expl = 0.75) {
## helper retrieving the top n species with the highest contribution to the patterns tested by the GLMs, in decreasing order.
## Arguments: glms.aov - results from an ANOVA on the fitted GLMs
## dev.explained - proportion of explained deviance to use as cutoff
## get the change in deviance due to the tested pattern (= 2nd row from table of univariate test stats), and sort the species in order of decreasing contribution
uni.sorted <- sort(glms.aov$uni.test[2, ], decreasing = TRUE, index.return = FALSE)
## start at 10 species and check how much of the deviance is explained by their contributions. Repeat, increasing by increments of 10 until the desired explained deviance (set at function call) is reached.
top.n.sp <- 10
dev.expl <- sum(uni.sorted[1:top.n.sp])/sum(uni.sorted)
while(dev.expl < tot.dev.expl) {
top.n.sp <- top.n.sp + 10
dev.expl <- sum(uni.sorted[1:top.n.sp])/sum(uni.sorted)
}
## print the total deviance explained - just for information
print(paste("Total deviance explained:", round(dev.expl, 3)))
## return the final top species (and their univariate contributions, just in case)
top.sp <- uni.sorted[1:top.n.sp]
return(top.sp)
}
## get the top contributing species for the initial sand GLMs
(top.sp.glms.lvm.sand <- top_n_sp_glm(glms.lvm.sand.aov, tot.dev.expl = 0.75)
)
## unfortunately, mvabund likes to rename my species when converting the data to matrix (no spaces in names), and since I'm going to look them up in my initial untransformed count data, I have to change them back..
names(top.sp.glms.lvm.sand) <- names(top.sp.glms.lvm.sand) %>%
str_replace(pattern = "\\.", replacement = " ")
top.sp.glms.lvm.sand
Try to plot these top contributing species - for whatever that’s worth, because 50 species on a plot is a monstrosity.
## get the species and their abundances from the original count data, and transform them to long format
(abnd.top.sp.glms.lvm.sand <- zoo.abnd.sand %>%
select(station, names(top.sp.glms.lvm.sand)) %>%
gather(key = "species", value = "count", -station) %>%
## turn species into a factor, or you'll be very very sorry later, when they're out of order on the plot. NB need to be in REVERSE order, because ggplot plots from bottom to top, and I want the top-contributing species on top.
mutate(species = factor(species, levels = rev(names(top.sp.glms.lvm.sand))))
)
plot_top_n <- function(top.n.sp.data, mapping, labs.legend, lab.y, palette) {
## helper for plotting top n species. Was hoping to avoid repeating it from way back when, but no dice.
## Arguments: top.n.sp.data - data frame (long) of top species' counts/biomasses at the different stations
## mapping - mappings of the aesthetics
## labs.legend - labels the use for the legend entries
## lab.y - custom label for y axis
## palette - custom colour palette (for consistency with other plots)
ggplot(top.n.sp.data, mapping) +
geom_point(alpha = 0.75) + # make points larger & partially transparent
scale_color_brewer(palette = palette, labels = labs.legend) +
ylab(lab.y) +
coord_flip()
}
(plot.top.sp.glms.lvm.sand <- plot_top_n(abnd.top.sp.glms.lvm.sand,
mapping = aes(x = species, y = log_y_min(count), colour = station),
labs.legend = paste0("S", as.numeric(unique(abnd.top.sp.glms.lvm.sand$station))),
lab.y = "Abundance (log(y/min + 1))",
palette = "Set2"
) +
theme(legend.position = "top")
)
Well this is a nightmarish plot.. I’ll probably just put this awfulness in a table and call it a day, or play with lvsplot and the modeled ordination plot, if a plot is what’s needed.
Extract the top-contributing species to each cluster (this same nightmare above, but as a table). This chunk is hopelessly ugly and clumsy (and I’ll have to repeat it for the seagrass, too!), but I’m tired of being stuck on this. I still have many, MANY more things to do, and more time-consuming ones too..
top_sp_glms_table <- function(manyglms.obj.smry, group, p = 0.05) {
### extracts the top species in a group for which there is an observed effect in a manyglm test, at the specified probability level.
### Returns: tibble with the top species for the specified group/cluster, sorted (descending) by univariate LR value of the species, significant at the given p level.
## extract the univariate LR coefficients of the species and their p-values
sp_univar <- as_tibble(manyglms.obj.smry$uni.test, rownames = "species")
sp_p <- as_tibble(manyglms.obj.smry$uni.p, rownames = "species")
## combine in the same tibble
sp_all <- left_join(sp_univar, sp_p, by = "species")
## rename the columns
sp_all <- sp_all %>%
rename_at(vars(contains(".x")), list(~str_replace_all(., pattern = ".x", ".LR"))) %>%
rename_at(vars(contains(".y")), list(~str_replace_all(., pattern = ".y", ".p")))
## filter only the group/cluster we want, at the p-level we want
sp_all_flt <- sp_all %>%
select(species, contains(group)) %>%
filter_at(vars(contains(".p")), all_vars(. < p)) %>%
arrange_at(vars(contains(".LR")), list(~desc(.)))
}
top.sp.abnd.glms.lvm.sand <- lapply(names(glms.lvm.sand.summary$aliased), function(x) top_sp_glms_table(glms.lvm.sand.summary, x, p = 0.05))
## fix species names (remove dot)
top.sp.abnd.glms.lvm.sand <- lapply(top.sp.abnd.glms.lvm.sand, function(x) x %>% mutate(species = str_replace(species, pattern = "\\.", replacement = " ")))
## rename columns (= group names) - right now they are something like "lvm.clusters.sand2" etc.
top.sp.abnd.glms.lvm.sand <- lapply(top.sp.abnd.glms.lvm.sand, function(x) x %>% rename_at(vars(contains("lvm.clusters.sand")), list(~str_replace_all(., pattern = "lvm.clusters.sand", "group_"))))
top.sp.abnd.glms.lvm.sand <- lapply(top.sp.abnd.glms.lvm.sand, function(x) x %>% rename_at(vars(contains("Intercept")), list(~str_replace_all(., pattern = "\\(Intercept\\)", "group_1"))))
## pull the abundances from the original count df and add to the summary glm tables
## make a long df of abundances & add clusters
zoo.abnd.sand.long <- zoo.abnd.sand %>%
select(-c(month:replicate)) %>%
gather(key = "species", value = "count", -station) %>%
mutate(group = case_when(station %in% c("Kraimorie", "Chukalya") ~ 1,
station == "Akin" ~ 2,
station %in% c("Sozopol", "Paraskeva") ~ 3,
station == "Agalina" ~ 4))
## sum sp abundances by group; nest by group
zoo.abnd.sand.long.smry <- zoo.abnd.sand.long %>%
group_by(species, group) %>%
summarise(total_count = sum(count)) %>%
group_by(group) %>%
nest()
## add the counts to the group dfs - wow that's an ugly, ugly hack. Wish I had more time to write this up properly..
top.sp.abnd.glms.lvm.sand <- map2(top.sp.abnd.glms.lvm.sand, zoo.abnd.sand.long.smry %>% pull(group), ~left_join(.x, zoo.abnd.sand.long.smry %>% filter(group == .y) %>% unnest(), by = "species"))
## since these are sum counts over all the replicates (that's why the monstrous numbers), average them to be mean counts per group. NB different groups consist of different numbers of replicates, b.c. some groups consist of more than one station
(top.sp.abnd.glms.lvm.sand <- map2(top.sp.abnd.glms.lvm.sand, c(18, 9, 18, 9), function(x, y) x %>% mutate(mean_count = total_count/y))
)
To determine the relative taxon contribution to patterns: LR statistic - a measure of strength of individual taxon contributions. LR expresses how many times more likely the data are under one model than the other. This likelihood ratio, or equivalently its logarithm, can then be used to compute a p-value, or, compared to a critical value, to decide whether to reject the null model in favour of the alternative model.
In this case, the model shows which species exhibit a reaction based on the chosen groups - in other words, which species are more likely to be more/less abundant in each group.
For group 1 (= S1-S2), the species/taxa with significantly higher abundance are: Oligochaeta, H. filiformis, P. kefersteini, M. palmata, P. cirrifera, A. diadema (among others); and the ones with significantly lower abundance - even 0, in some cases - S. bidentata, B.lanceolatum, M. papillicornis, Melita palmata, P. jubatus, and so on.
For group 2 (= S3), the species with higher abundance are: B. lanceolatum, O. limacina, Oligochaeta (this is this strange artifact of 2013), P. kefersteini, L. flavocapitatus. The species with lower abundance are: H. filiformis, A. kagoshimensis, M. stammeri, Melinna palmata, etc. For group 3 (= S4-S6), the species with higher abundance are: C. gallina, L. mediterraneum - with very high dominance over practically all others; also Pseudocuma longicorne, Spio filicornis. The species with lower abundance are: H. filiformis, Oligochaetes (to a certain extent - they are still present, though), A. kagoshimensis, L. koreni, Harmothoe reticulata, Iphinoe tenella, Leiochone leiopygos.
For group 4 (= S5), the species with higher abundance are: Microdeutopus versiculatus, Eurydice dollfusi, Melita palmata, Polygordius neapolitanus, Polycirrus caliendrum, Polycirrus jubatus, Streptosyllis bidentata. The species with lower abundance are: A. kagoshimensis, Melinna palmata, P. cirrifera, P. ciliata, A. alba, I. tenella.
I love how the species with the highest variances (e.g. C. gallina, the most conspicuous example) are consistently pushed back - have lower LR scores. This is very good - C. gallina in particular is dominant in group 3, but is present also in all other groups - its substrate/depth preferences are very wide, so this is not uncommon. It’s not automatically pushed to the top of the list, but its reaction is detected by the manyGLM test. Neat! Contrast to the SIMPER results, where the species with the highest variance are consistently at the top - they contribute the most to the similarity, as per the test definition.
I’m going to save these as separate files (manually), then format them as tables - I know it’s a shame, but I’m too frustrated to figure out how to do it programmatically.
I’ll also put them in a word table in my final text, because I don’t want to deal with a million separate ones (embedded excel tables don’t split over multiple pages).
NB In my text, I’m switching the names/places of group 3 and 4, to be consistent with the SIMPER groups (I’m NOT going to repeat all this just to have the numbers match up). So the file names, table names, etc. remain as above. But in the text, I’ll have the following: group 1 = S1-S2, group 2 = S3, group 3 = S5, group 4 = S4-S6. REMEMBER THIS SO THERE IS NO CONFUSION!
Now, let’s try to see a different thing - which environmental parameters best describe the species response.
I’m going to use the PCA-filtered environmental data - it’s still going to be a slog, with 7 potential predictors..
First, construct the formula for the model - will do it separately in case I need to update it later, etc. This is the full formula with all explanatory variables.
(formula.env.glms.sand <- formula(paste("zoo.mvabnd.sand ~",
paste(env.sand %>% select(-station) %>% names(), collapse = "+")))
)
Fit the GLMs to the sand abundance data.
env.glms.sand <- manyglm(formula.env.glms.sand,
data = env.sand,
family = "negative.binomial")
Explore the fit (residuals, diagnostic plots, etc.).
## residuals vs fitted values
plot(env.glms.sand)
## all traditional (g)lm diagnostic plots
plot.manyglm(env.glms.sand, which = 1:3)
# ### source mvabund GLM plotting functions modified to use a grey palette - I just can't redo these plots on my own, the function is doing too complicated things internally to scale the x and y axes
# source(here(functions.dir, "default.plot.manyglm_grey.R"))
# source(here(functions.dir, "plot.manyglm_grey.R"))
#
# par(mfrow = c(2,2))
# lapply(1:3, function(i) plot.manyglm.grey(glms.lvm.sand, which = i, sub.caption = ""))
# par(mfrow = c(1, 1))
Well, it’s good enough if you ask me (still the kinda strange “line” at lin.pred = -6; otherwise residuals are random enough).
Save the model!
write_rds(env.glms.sand,
here(save.dir, "glms_env_sand.RDS"))
Before anything else, I want to try and reduce the model a little - to improve the fit/reduce run time.
The automatic step functions that eliminate/add model terms sequentially don’t work - they fail at the last step with a cryptic error about differing numbers of rows - I assume because manyglm has as left side term the whole community abundance matrix, and the functions don’t really know how to deal with that. I don’t understand enough about their internals to fix the problem, so I’m just going to write my own little automation based on the function drop1.
evaluate_glms_env <- function(full.mod) {
### sequentially eliminate model terms in manyglms vs environmental parameters, and find the best model based on lowest AIC score.
### Arguments: full.mod - full model fit
### Returns: best manyglm model of environmental parameters; prints out the best model formula
### Dependencies: tidyverse
## get the starting formula (= full model with all variables)
start.formula <- formula(full.mod)
drop_var <- function(mod) {
### helper picking the next variable to drop from a model to improve the fit (based on AIC)
## check the model AICs if variables are dropped one by one
drop1.df <- as_tibble(drop1(mod), rownames = "drop_var") %>% arrange(AIC)
## pick the variable to drop next - the one resulting in the largest decrease in AIC
drop.var <- drop1.df %>% filter(AIC == min(AIC)) %>% pull(drop_var)
return(drop.var)
}
## pick the variable to drop next
drop.var <- drop_var(full.mod)
if(drop.var != "<none>") {
## update the model formula, dropping the variable resulting in the largest decrease in AIC; then apply it to the model.
new.formula <- update.formula(start.formula, paste0("~. -", drop.var))
new.mod <- update(full.mod, new.formula)
## identify a new variable to drop that lowers the AIC
drop.var <- drop_var(new.mod)
## repeat the steps above until the function can no longer find such a variable (i.e., dropping more variables doesn't improve the model fit)
while(drop.var != "<none>") {
new.formula <- update.formula(new.formula, paste0("~. -", drop.var))
new.mod <- update(full.mod, new.formula)
drop.var <- drop_var(new.mod)
}
## print out the best model formula
print(paste("Best model: ", paste(deparse(new.formula), collapse = "")))
return(new.mod)
} else {
## if the starting model is the best, print its formula (fat chance!)
print(paste("Best model: ", paste(deparse(start.formula), collapse = "")))
return(full.mod)
}
}
Select the best reduced model of environmental variables for the sand stations.
## selection function defined in the sand section
top.env.glm.red.sand <- evaluate_glms_env(env.glms.sand)
Check its fit.
## residuals vs fitted values
plot(top.env.glm.red.sand)
## all traditional (g)lm diagnostic plots
plot.manyglm(top.env.glm.red.sand, which = 1:3)
I think it’s fine; might even be better than the full model.. Save it, too.
write_rds(top.env.glm.red.sand,
here(save.dir, "glms_top_env_red_sand.RDS"))
Run ANOVA on this model.
(top.env.glm.red.sand.aov <- anova.manyglm(top.env.glm.red.sand,
test = "LR", p.uni = "adjusted",
nBoot = 999, ## limit the number of permutations for a shorter run time
show.time = "all")
)
Resampling begins for test 1.
Resampling run 0 finished. Time elapsed: 0.01 minutes...
Resampling run 100 finished. Time elapsed: 0.58 minutes...
Resampling run 200 finished. Time elapsed: 1.18 minutes...
Resampling run 300 finished. Time elapsed: 1.76 minutes...
Resampling run 400 finished. Time elapsed: 2.35 minutes...
Resampling run 500 finished. Time elapsed: 2.95 minutes...
Resampling run 600 finished. Time elapsed: 3.56 minutes...
Resampling run 700 finished. Time elapsed: 4.18 minutes...
Resampling run 800 finished. Time elapsed: 4.79 minutes...
Resampling run 900 finished. Time elapsed: 5.43 minutes...
Resampling begins for test 2.
Resampling run 0 finished. Time elapsed: 0.00 minutes...
Resampling run 100 finished. Time elapsed: 0.36 minutes...
Resampling run 200 finished. Time elapsed: 0.73 minutes...
Resampling run 300 finished. Time elapsed: 1.09 minutes...
Resampling run 400 finished. Time elapsed: 1.47 minutes...
Resampling run 500 finished. Time elapsed: 1.83 minutes...
Resampling run 600 finished. Time elapsed: 2.21 minutes...
Resampling run 700 finished. Time elapsed: 2.58 minutes...
Resampling run 800 finished. Time elapsed: 2.95 minutes...
Resampling run 900 finished. Time elapsed: 3.30 minutes...
Resampling begins for test 3.
Resampling run 0 finished. Time elapsed: 0.00 minutes...
Resampling run 100 finished. Time elapsed: 0.35 minutes...
Resampling run 200 finished. Time elapsed: 0.70 minutes...
Resampling run 300 finished. Time elapsed: 1.04 minutes...
Resampling run 400 finished. Time elapsed: 1.38 minutes...
Resampling run 500 finished. Time elapsed: 1.73 minutes...
Resampling run 600 finished. Time elapsed: 2.08 minutes...
Resampling run 700 finished. Time elapsed: 2.43 minutes...
Resampling run 800 finished. Time elapsed: 2.79 minutes...
Resampling run 900 finished. Time elapsed: 3.15 minutes...
Resampling begins for test 4.
Resampling run 0 finished. Time elapsed: 0.00 minutes...
Resampling run 100 finished. Time elapsed: 0.32 minutes...
Resampling run 200 finished. Time elapsed: 0.64 minutes...
Resampling run 300 finished. Time elapsed: 0.95 minutes...
Resampling run 400 finished. Time elapsed: 1.27 minutes...
Resampling run 500 finished. Time elapsed: 1.58 minutes...
Resampling run 600 finished. Time elapsed: 1.89 minutes...
Resampling run 700 finished. Time elapsed: 2.20 minutes...
Resampling run 800 finished. Time elapsed: 2.51 minutes...
Resampling run 900 finished. Time elapsed: 2.83 minutes...
Time elapsed: 0 hr 16 min 18 sec
Analysis of Deviance Table
Model: manyglm(formula = zoo.mvabnd.sand ~ PO4 + seston + LUSI + gravel,
Model: family = "negative.binomial", data = env.sand)
Multivariate test:
Res.Df Df.diff Dev Pr(>Dev)
(Intercept) 53
PO4 52 1 1147.2 0.001 ***
seston 51 1 816.4 0.001 ***
LUSI 50 1 728.5 0.001 ***
gravel 49 1 1128.7 0.001 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Univariate Tests:
Abra.alba Abra.sp. Acanthocardia.tuberculata
Dev Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
PO4 1.011 1.000 0.513 1.000 3.576 0.979
Acari Actiniaria Alitta.succinea
Dev Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
PO4 10.498 0.120 0.513 1.000 0.065 1.000
Ampelisca.diadema Amphibalanus.improvisus Amphipoda
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
PO4 12.592 0.032 11.462 0.081 0.552
Amphitritides.gracilis Ampithoe.sp.
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
PO4 1.000 2.571 1.000 0.032 1.000
Anadara.kagoshimensis Aonides.paucibranchiata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
PO4 67.791 0.001 5.965 0.659
Apseudopsis.ostroumovi Aricidea.claudiae
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
PO4 0.375 1.000 7.633 0.402
Bathyporeia.guilliamsoniana Bittium.reticulatum
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
PO4 0.002 1.000 22.784 0.002
Bodotria.arenosa Brachynotus.sexdentatus
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
PO4 1.3 1.000 11.298 0.085
Brachystomia.scalaris Branchiostoma.lanceolatum
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
PO4 0.696 1.000 0.057 1.000
Caecum.armoricum Caecum.trachea Capitella.capitata
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
PO4 7.463 0.427 1.119 1.000 1.193
Capitella.minima Cardiidae Cerastoderma.edule
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
PO4 1.000 2.53 1.000 0.513 1.000 7.708
Cerastoderma.glaucum Chamelea.gallina
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
PO4 0.384 1.415 1.000 27.316 0.001
Chondrochelia.savignyi Crassicorophium.crassicorne
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
PO4 1.246 1.000 0.459 1.000
Cumopsis.goodsir Cytharella.costulata Decapoda.larvae
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
PO4 3.576 0.969 16.556 0.008 4.389
Dinophilus.gyrociliatus Diogenes.pugilator
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
PO4 0.845 3.462 0.988 2.328 1.000
Donax.venustus Elaphognathia.bacescoi Eteone.flava
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
PO4 11.663 0.069 1.021 1.000 7.158
Eteone.sp. Eulalia.viridis Eunice.vittata
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
PO4 0.480 3.247 0.996 0.508 1.000 5.957
Eurydice.dollfusi Eurydice.pontica
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
PO4 0.659 7.553 0.419 0.243 1.000
Exogone.naidina Gammaridae Gastrosaccus.sanctus
Dev Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
PO4 1.544 1.000 0.215 1.000 0.001 1.000
Genetyllis.tuberculata Glycera.sp. Glycera.tridactyla
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
PO4 9.748 0.149 1.819 1.000 4.038
Harmothoe.imbricata Harmothoe.reticulata
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
PO4 0.882 7.572 0.416 6.871 0.582
Heteromastus.filiformis Hirudinea Holothuroidea
Dev Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
PO4 55.658 0.001 4.073 0.876 6.327 0.634
Hydrobia.acuta Hydrobia.sp. Iphinoe.sp.
Dev Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
PO4 3.566 0.988 3.379 0.993 0.243 1.000
Iphinoe.tenella Kellia.suborbicularis Lagis.koreni
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
PO4 38.241 0.001 12.137 0.052 48.067
Leiochone.leiopygos Lentidium.mediterraneum
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
PO4 0.001 20.554 0.003 16.232 0.009
Leptosynapta.inhaerens Lindrilus.flavocapitatus
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
PO4 3.875 0.905 4.746 0.795
Loripes.orbiculatus Lucinella.divaricata Lysidice.ninetta
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
PO4 14.871 0.012 19.259 0.004 0.243
Mactra.stultorum Magelona.papillicornis
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
PO4 1.000 2.401 1.000 19.059 0.004
Magelona.rosea Maldanidae Melinna.palmata
Dev Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
PO4 4.77 0.795 3.576 0.979 75.355 0.001
Melita.palmata Microdeutopus.gryllotalpa Microdeutopus.sp.
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
PO4 14.255 0.019 0.001 1.000 3.576
Microdeutopus.versiculatus Micromaldane.ornithochaeta
Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
PO4 0.971 9.28 0.172 10.809
Micronephthys.stammeri Microphthalmus.fragilis
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
PO4 0.098 0.016 1.000 0.028 1.000
Microphthalmus.sp. Monocorophium.acherusicum
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
PO4 8.692 0.220 3.627 0.966
Monocorophium.insidiosum Mysta.picta Mytilaster.lineatus
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
PO4 7.646 0.401 4.088 0.876 9.876
Mytilus.galloprovincialis Neanthes.sp. Nemertea
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
PO4 0.143 0.507 1.000 1.415 1.000 0.718
Nephtyidae Nephtys.cirrosa Nereididae
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
PO4 1.000 3.733 0.931 3.455 0.989 0.243 1.000
Nereis.pelagica Nereis.perivisceralis Nereis.pulsatoria
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
PO4 1.278 1.000 5.021 0.764 1.04
Nototropis.guttatus Odostomia.plicata Oligochaeta
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
PO4 1.000 0.017 1.000 2.158 1.000 12.804
Ophelia.limacina Papillicardium.papillosum
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA> <NA>
PO4 0.032 1.13 1.000 1.026 1.000
Paradoneis.harpagonea Parthenina.interstincta
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA>
PO4 16.021 0.009 0.628 1.000
Parvicardium.exiguum Perinereis.cultrifera
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA>
PO4 14.43 0.013 6.906 0.582
Perioculodes.longimanus Pestarella.candida Pholoe.inornata
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept) <NA> <NA> <NA> <NA> <NA>
PO4 13.283 0.026 1.021 1.000 2.532
Phoronida Phyllodoce.sp. Pisces.larvae
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA> <NA> <NA> <NA>
PO4 1.000 14.128 0.020 0.214 1.000 3.566 0.979
Pisione.remota Pitar.rudis Platyhelminthes
Dev Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA> <NA> <NA>
PO4 0.184 1.000 2.33 1.000 1.258 1.000
Platynereis.dumerilii Polititapes.aureus Polychaeta.larvae
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept) <NA> <NA> <NA> <NA> <NA>
PO4 2.51 1.000 5.232 0.758 0.667
Polycirrus.caliendrum Polycirrus.jubatus
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA> <NA>
PO4 1.000 8.778 0.213 14.046 0.021
Polydora.ciliata Polygordius.neapolitanus
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA>
PO4 33.47 0.001 1.738 1.000
Prionospio.cirrifera Protodorvillea.kefersteini
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA>
PO4 48.371 0.001 2.268 1.000
Protodrilus.sp. Pseudocuma.longicorne Rapana.venosa
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept) <NA> <NA> <NA> <NA> <NA>
PO4 0.497 1.000 13.533 0.024 16.327
Retusa.truncatula Retusa.variabilis
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA> <NA>
PO4 0.008 0.513 1.000 4.77 0.795
Rhithropanopeus.harrisii Rissoa.membranacea
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA>
PO4 1.021 1.000 2.111 1.000
Sabellaria.taurica Salvatoria.clavata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA>
PO4 16.327 0.008 2.946 0.999
Schistomeringos.rudolphi Sphaerosyllis.hystrix
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA>
PO4 11.176 0.087 3.042 0.998
Spio.filicornis Spionidae Spisula.subtruncata
Dev Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA> <NA> <NA>
PO4 8.141 0.262 0.278 1.000 34.272 0.001
Stenothoe.monoculoides Sternaspis.scutata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA>
PO4 1.021 1.000 0.497 1.000
Steromphala.divaricata Streptosyllis.bidentata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA>
PO4 3.62 0.966 14.133 0.020
Syllis.gracilis Syllis.hyalina Tellina.fabula
Dev Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA> <NA> <NA>
PO4 1.059 1.000 11.199 0.086 7.846 0.291
Tellina.tenuis Tritia.neritea Tritia.reticulata
Dev Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA> <NA> <NA>
PO4 5.219 0.758 9.738 0.149 7.578 0.416
Turbellaria Upogebia.pusilla
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA>
PO4 0.973 1.000 1.021 1.000
[ reached getOption("max.print") -- omitted 3 rows ]
Arguments:
Test statistics calculated assuming uncorrelated response (for faster computation)
P-value calculated using 999 resampling iterations via PIT-trap resampling (to account for correlation in testing.
So, it turns out that the long-term water column eutrophication (PO4, seston), the anthropogenic pressure in general (LUSI), and the sediment composition (gravel) explain the observed community patterns best.
Save the ANOVA - I really, really don’t want to have to repeat it.
write_rds(top.env.glm.red.sand.aov,
here(save.dir, "glms_top_env_red_sand_anova.RDS"))
Get the taxa with the highest contributions to the tested pattern (here - species most affected by changes in water/environmental quality parameters).
## get the top contributing species for the environmental parameter sand GLMs
(top.sp.glms.env.red.sand <- top_n_sp_glm(top.env.glm.red.sand.aov, tot.dev.expl = 0.75)
)
[1] "Total deviance explained: 0.817"
Melinna.palmata Anadara.kagoshimensis Heteromastus.filiformis
75.354817 67.790515 55.657621
Prionospio.cirrifera Lagis.koreni Iphinoe.tenella
48.371413 48.067236 38.240757
Spisula.subtruncata Polydora.ciliata Chamelea.gallina
34.272034 33.469990 27.316472
Bittium.reticulatum Leiochone.leiopygos Lucinella.divaricata
22.783736 20.553990 19.259453
Magelona.papillicornis Cytharella.costulata Sabellaria.taurica
19.059044 16.556175 16.326603
Rapana.venosa Lentidium.mediterraneum Paradoneis.harpagonea
16.326603 16.231882 16.021000
Loripes.orbiculatus Parvicardium.exiguum Melita.palmata
14.870959 14.429942 14.255372
Streptosyllis.bidentata Phoronida Polycirrus.jubatus
14.133303 14.128398 14.045827
Pseudocuma.longicorne Perioculodes.longimanus Oligochaeta
13.533423 13.282665 12.804148
Ampelisca.diadema Kellia.suborbicularis Donax.venustus
12.591581 12.137452 11.662509
Amphibalanus.improvisus Brachynotus.sexdentatus Syllis.hyalina
11.462125 11.298400 11.198693
Schistomeringos.rudolphi Micromaldane.ornithochaeta Acari
11.176121 10.809322 10.498478
Mytilaster.lineatus Genetyllis.tuberculata Tritia.neritea
9.875996 9.747742 9.737885
Microdeutopus.versiculatus Polycirrus.caliendrum Microphthalmus.sp.
9.280497 8.778395 8.692123
Spio.filicornis Tellina.fabula Cerastoderma.edule
8.140655 7.845543 7.707880
Monocorophium.insidiosum Aricidea.claudiae Tritia.reticulata
7.646026 7.632964 7.577649
Harmothoe.imbricata Eurydice.dollfusi
7.571700 7.553233
## unfortunately, mvabund likes to rename my species when converting the data to matrix (no spaces in names), and since I'm going to look them up in my initial untransformed count data, I have to change them back.. DON'T BE IN A HURRY TO DO THAT IF YOU WANT TO SUBSET THE ORIGINAL MATRIX BEFORE RUNNING TRAITGLM
names(top.sp.glms.env.red.sand) <- names(top.sp.glms.env.red.sand) %>%
str_replace(pattern = "\\.", replacement = " ")
I’m going to plot these top contributing species, but I’m not using the plot. At least this time it’s more manageable, but still not presentable enough..
## get the species and their abundances from the original count data, and transform them to long format
abnd.top.sp.glms.env.red.sand <- zoo.abnd.sand %>%
select(station, names(top.sp.glms.env.red.sand)) %>%
gather(key = "species", value = "count", -station) %>%
## turn species into a factor, or you'll be very very sorry later, when they're out of order on the plot. NB need to be in REVERSE order, because ggplot plots from bottom to top, and I want the top-contributing species on top.
mutate(species = factor(species, levels = rev(names(top.sp.glms.env.red.sand)))) %>%
## add clusters from LVM as a column
mutate(group = case_when(station %in% c("Kraimorie", "Chukalya") ~ 1,
station == "Akin" ~ 2,
station %in% c("Sozopol", "Paraskeva") ~ 3,
station == "Agalina" ~ 4))
## add the significant environmental parameters from the model
(abnd.top.sp.glms.env.red.sand <- left_join(abnd.top.sp.glms.env.red.sand,
env.sand %>% select(station, PO4, seston, LUSI, gravel),
by = "station")
)
(plot.top.sp.glms.env.red.sand <- plot_top_n(abnd.top.sp.glms.env.red.sand,
mapping = aes(x = species, y = log_y_min(count), colour = factor(group)),
labs.legend = unique(abnd.top.sp.glms.env.red.sand$group),
lab.y = "Abundance (log(y/min + 1))",
palette = "Set2") +
theme(legend.position = "top")
)
FIXME>>> Try another thing - manually, unfortunately: this same nightmare, but colored by the values of each model term.
Extract the taxon information (univariate tests) from the model ANOVA to present as a table (probably better than this plot, although it’s informative).
## extract the univariate test coefficients (LR) from the environmental model ANOVA. NB keep the row names when converting the matrix to tibble!
table.top.sp.glms.env.red.sand <- as_tibble(top.env.glm.red.sand.aov$uni.test, rownames = "var")
## fix the species names - remove first dor
names(table.top.sp.glms.env.red.sand) <- names(table.top.sp.glms.env.red.sand) %>%
str_replace(pattern = "\\.", replacement = " ")
## subset only the top species (explaining ~75% of the dataset variation)
table.top.sp.glms.env.red.sand <- table.top.sp.glms.env.red.sand %>%
select(var, names(top.sp.glms.env.red.sand))
## transpose, because a table with 50 columns is just unreadable
(table.top.sp.glms.env.red.sand <- table.top.sp.glms.env.red.sand %>%
gather(key = species, value = value, -var) %>%
spread(key = var, value = value) %>%
## arrange as before (terms in the order they appear in the model, and by descending value of the LR for the first model term - here, PO4). Also get rid of the intercept (it's all-NA anyway).
select(species, PO4, seston, LUSI, gravel) %>%
arrange(desc(PO4))
)
Save this to a file - will have to format it as a nice table by hand, unfortunately.
write_csv(table.top.sp.glms.env.red.sand,
here(save.dir, "taxa_contrib_glms_top_env_red_sand.csv"))
Calculate the percentage contribution of each of these species to each of the model terms (Dev(term) = Sum-of-LR - sum of the LRs for the individual univariate species tests)..
## get the total deviance (Sum-of-LR) for each model term
(dev.terms.top.glms.env.sand <- as_tibble(top.env.glm.red.sand.aov$table, rownames = "var") %>%
## get rid of unnecessary variables (I only want the deviance value for each term) and intercept term
select(var, Dev) %>%
filter(var != "(Intercept)") %>%
## transpose
gather(variable, value, -var) %>%
spread(var, value) %>%
## get rid of first column and rearrange columns to match table of deviances of univariate tests for species
select(-variable) %>%
select(PO4, seston, LUSI, gravel)
)
## calculate the proportion contribution of each species to each parameter deviance
prop.top.sp.glms.env.red.sand <- map2_df(table.top.sp.glms.env.red.sand %>% select(-species),
dev.terms.top.glms.env.sand,
~.x/.y)
## add back the species
(prop.top.sp.glms.env.red.sand <- bind_cols(table.top.sp.glms.env.red.sand %>% select(species),
prop.top.sp.glms.env.red.sand)
)
Final analysis to try: which species respond differently to different environmental parameters? (= traits analysis - fit single predictive model for all species at all sites, but w/o attempting to explain the different responses using traits - the species ID is used in place of a traits matrix).
NB only use the top species that exhibited a reaction in the environmental model fit (= the ones accounting for ~75% of the total variability), and only the significant predictors - to improve run times.
sp.response.glms.env.red.sand <- traitglm(L = mvabund(zoo.abnd.flt.sand[, names(top.sp.glms.env.red.sand)]),
R = as.matrix(env.sand %>% select(PO4, seston, LUSI, gravel)),
method = "manyglm")
No traits matrix entered, so will fit SDMs with different env response for each spp
sp.response.glms.env.red.sand$fourth.corner
PO4 seston LUSI gravel
names.L.Ampelisca.diadema 3.9255509 -2.9690187 -0.817892764 -0.54638276
names.L.Amphibalanus.improvisus 4.0226904 -3.2428168 -0.613822194 -0.55947227
names.L.Anadara.kagoshimensis 11.2652127 -7.5624621 -2.881581827 -0.56229429
names.L.Aricidea.claudiae 6.4545107 -6.0030102 0.075837116 -0.81658105
names.L.Bittium.reticulatum 3.6728293 -3.2566010 -0.227682651 -0.60908662
names.L.Brachynotus.sexdentatus 12.2714488 -8.7953746 -2.768356521 -1.15909023
names.L.Cerastoderma.edule 86.3144545 -68.5410436 -16.124587996 -15.76009706
names.L.Chamelea.gallina 4.9735567 -4.0806520 -0.915304631 -0.90870404
names.L.Cytharella.costulata 5.9066074 -4.5531016 -1.156170995 -0.64061054
names.L.Donax.venustus 29.2665146 -25.3133054 -3.196472244 -7.48930781
names.L.Eurydice.dollfusi -145.3134807 78.0140182 56.500452934 -1.12048695
names.L.Genetyllis.tuberculata 4.9508698 -4.4226734 -0.717237975 -0.50545895
names.L.Harmothoe.imbricata 8.7688494 -8.0381252 -0.174424875 -1.40001396
names.L.Heteromastus.filiformis 16.4489612 -11.8603189 -4.679979720 -0.53453476
names.L.Iphinoe.tenella 9.6429106 -6.3711957 -2.467970830 -0.34728546
names.L.Kellia.suborbicularis 18.1479826 -13.1444944 -4.028384566 -2.38364695
names.L.Lagis.koreni 5.2752482 -3.9409882 -1.063633817 -0.49005707
names.L.Leiochone.leiopygos 9.4458023 -7.0107877 -2.426883847 -0.49499547
names.L.Lentidium.mediterraneum 2.2184223 -7.7274293 5.119259705 -3.80721597
names.L.Loripes.orbiculatus 11.9138363 -10.5152606 -1.772124177 -1.53849109
names.L.Lucinella.divaricata 4.3089522 -3.8383729 -0.941760570 -0.90040958
names.L.Magelona.papillicornis -0.8618886 -1.6184538 2.126924166 -1.13824665
names.L.Melinna.palmata 87.5950547 -62.3176332 -28.320862498 -0.53785792
names.L.Melita.palmata -1.4068078 -1.4310911 2.175555342 0.04534594
names.L.Microdeutopus.versiculatus 4.5619062 -3.3188059 -1.480537959 0.01704370
names.L.Micromaldane.ornithochaeta 2.0293951 -3.6054716 1.146677297 -1.10488159
names.L.Microphthalmus.sp. 2.4219932 -2.3771910 -0.331905804 -0.45014535
names.L.Monocorophium.insidiosum 91.2704372 -72.4819591 -16.997678796 -16.75142841
names.L.Mytilaster.lineatus 3.6452068 -3.0310816 -0.453771212 -0.56603117
names.L.Oligochaeta 1.1142783 -0.9168759 0.182815777 -0.26804214
names.L.Paradoneis.harpagonea 44.6268239 -34.6189865 -10.110156651 -6.18181742
names.L.Parvicardium.exiguum 5.4679515 -4.2901258 -1.071674867 -0.60043740
names.L.Perioculodes.longimanus 3.8233980 -3.1155895 -0.537523634 -0.55747087
names.L.Phoronida 4.3674755 -4.1186121 -0.107432136 -0.69239101
names.L.Polycirrus.caliendrum -14.6362720 -14.5110317 24.537891679 -3.49252794
names.L.Polycirrus.jubatus -2.4679942 -2.7467481 4.271575754 -0.36118532
names.L.Polydora.ciliata 5.8538836 -4.5251508 -1.054314612 -0.53519651
names.L.Prionospio.cirrifera 4.6312252 -3.5794420 -0.682191827 -0.61411757
names.L.Pseudocuma.longicorne -184.7247688 94.1777708 77.116820970 -2.87857061
names.L.Rapana.venosa 6.2536074 -5.8242086 0.109640812 -0.74952507
names.L.Sabellaria.taurica 6.4201209 -5.9779189 0.094454203 -0.79630833
names.L.Schistomeringos.rudolphi 8.9818953 -6.6900990 -3.539271831 -0.05466283
names.L.Spio.filicornis 23.9025062 -18.4529248 -3.775190226 -6.60866099
names.L.Spisula.subtruncata 8.3692147 -6.4982724 -1.857417192 -1.49042998
names.L.Streptosyllis.bidentata -1.7193139 -2.0772085 3.037260251 -0.16308400
names.L.Syllis.hyalina -1.4595610 -2.6762110 3.349712166 -0.32574204
names.L.Tellina.fabula 91.2704372 -72.4819591 -16.997678816 -16.75142841
names.L.Tritia.neritea -3.8087181 -2.4272915 5.454585358 -1.65134985
names.L.Tritia.reticulata 2.6224780 -1.4687956 0.003212383 -0.74189472
# plot this
a <- max(abs(sp.response.glms.env.red.sand$fourth.corner))
colort <- colorRampPalette(c("blue","white","red"))
plot.spp <- lattice::levelplot(t(as.matrix(sp.response.glms.env.red.sand$fourth.corner)), xlab = "Environmental Variables",
ylab = "Species", col.regions = colort(100), at = seq(-a, a, length = 100),
scales = list(x = list(rot = 45)))
print(plot.spp)
When using LASSO (method = “glm1path”), the algorithm fails to converge - I’m not sure how to interpret it.. Maybe because the function tests each individual species:env.parameter interaction (does it really??), and none of them by themselves are sufficient to explain a species’ response. Not to mention the fact that the samples are not really independent (they are replicates at 6 sites, repeated 3 times).
When using method = “manyglm”, the result is the one shown above. It’s still a bitch to interpret - for example, what is the interpretation of an increase in abundance with for ex. high PO4, but low LUSI? Where are these conditions ever met?
In fact, everything points towards the conclusion that a species response is determined by a combination of eutrophication parameters in its environment (water column characteristics), and the composition of the sediments (organic matter and granulometry).
This is actually sort of similar to the PERMANOVA results, in this particular case. However, it’s much more parsimonious.
In the future, I’m leaning more towards the modeling approach - it allows you to check the model fit to one’s real data; also, there are no data reductions due to calculation of distance matrices.
Import zoobenthic abundance data (cleaned and prepared).
zoo.abnd.zostera <- read_csv(here(save.dir, "abnd_zostera_orig_clean.csv"))
## convert station to factor (better safe than sorry later, when the stations are not plotted in the order I want them)
(zoo.abnd.zostera <- zoo.abnd.zostera %>%
mutate(station = factor(station, levels = c("Poda", "Otmanli", "Vromos", "Gradina", "Ropotamo")))
)
Remove the all-0 species (= not present in the current dataset).
Maybe also remove the singletons (species appearing only once in the whole dataset and represented by a single individual = so rare that it’s unlikely they carry important information, but it would probably improve the run times).
(zoo.abnd.flt.zostera <- zoo.abnd.zostera %>%
select(-c(station:replicate)) %>%
select(which(colSums(.) > 0))
)
Perform a model-based unconstrained ordination by fiting a pure latent variable model (package boral - Hui et al., 2014). This will allow to visualize the multivariate stations x species data - similar to nMDS, can be interpreted in the same way.
I’m including a (fixed) row effect to account for differences in site total abundance - this way, the ordination is in terms of species composition.
NB this takes about a million years to run!
lvm.zostera
$lv.median
lv
rows lv1 lv2
1 0.63309890 -0.25073642
2 0.71898027 -0.16747807
3 0.56064687 -0.42687215
4 0.55163657 -0.12469639
5 0.30959676 0.41773437
6 0.24697111 0.44574266
7 0.32890487 0.50038030
8 0.40977917 0.26925607
9 0.34411131 -0.05246175
10 0.30640639 0.05764798
11 -0.03303482 -0.31104596
12 0.33549294 0.06288344
13 -0.03183279 0.43841255
14 0.21965019 0.33806513
15 0.07264994 0.37467055
16 -0.13875265 0.24543515
17 0.33939011 -0.80630032
18 0.40882237 -0.80301467
19 0.59538891 -1.03245351
20 0.42986329 -1.04595929
21 -0.54406129 -0.20080826
22 -0.39667039 0.00322858
23 -0.41168940 -0.04570642
24 -0.25397763 0.02202463
25 -0.34106053 -0.05910581
26 -0.43321098 0.06874185
27 -0.50763931 0.14043786
28 -0.51347888 0.14183431
29 -0.47410593 -0.62677135
30 -0.55540307 -0.63339799
31 -0.34249913 -0.33267530
32 -0.47391655 -0.43313634
$lv.mean
lv
rows lv1 lv2
1 0.63973919 -0.26124190
2 0.72364848 -0.16915308
3 0.55817571 -0.44430628
4 0.55870462 -0.13461030
5 0.32617886 0.42590230
6 0.26749204 0.45848328
7 0.35558090 0.51461245
8 0.41640225 0.26949766
9 0.34581668 -0.05487866
10 0.31356211 0.06276810
11 -0.03221680 -0.30523138
12 0.34758050 0.05938987
13 -0.01393408 0.45245190
14 0.22407775 0.34634591
15 0.08224484 0.38367041
16 -0.13343400 0.25869559
17 0.34340933 -0.83616118
18 0.41423752 -0.82540763
19 0.59973842 -1.07749968
20 0.43460320 -1.10414702
21 -0.54179579 -0.19510291
22 -0.39926045 0.01451361
23 -0.41257931 -0.05011494
24 -0.25721275 0.03455823
25 -0.34203064 -0.04757744
26 -0.43318198 0.08075325
27 -0.51194024 0.13275752
28 -0.51837202 0.14297248
29 -0.47916725 -0.62290666
30 -0.56334375 -0.63658030
31 -0.34773465 -0.33506350
32 -0.47891407 -0.43205665
$lv.iqr
lv
rows lv1 lv2
1 0.3115049 0.3432342
2 0.2700754 0.3659362
3 0.2925739 0.3215977
4 0.2732491 0.3585541
5 0.2607338 0.3056026
6 0.2611162 0.2792944
7 0.2756551 0.2796141
8 0.2451521 0.3012650
9 0.2318232 0.2565478
10 0.2357820 0.2609933
11 0.2652560 0.2676580
12 0.2390352 0.2792553
13 0.2391694 0.2554568
14 0.2454424 0.2476183
15 0.2374709 0.2636803
16 0.2029496 0.2353137
17 0.4520713 0.3659810
18 0.4267797 0.3949317
19 0.5010253 0.4026903
20 0.5312290 0.3930040
21 0.2340643 0.2920227
22 0.2004030 0.2338392
23 0.2045751 0.2644804
24 0.1885636 0.2066522
25 0.1999420 0.2307883
26 0.2025090 0.2403377
27 0.1957638 0.2611411
28 0.2314553 0.2706260
29 0.2773997 0.2846295
30 0.2943060 0.3065804
31 0.2466440 0.2524183
32 0.2470145 0.2829039
$lv.sd
lv
rows lv1 lv2
1 0.2341917 0.2743629
2 0.2162751 0.2850905
3 0.2242427 0.2650938
4 0.2142396 0.2642869
5 0.1958259 0.2295734
6 0.1983309 0.2104188
7 0.2107166 0.2153038
8 0.1865497 0.2251835
9 0.1703594 0.2036468
10 0.1826565 0.2052637
11 0.1891908 0.1905564
12 0.1886136 0.2189078
13 0.1870533 0.1969266
14 0.1821220 0.1903206
15 0.1791703 0.1910769
16 0.1518936 0.1748393
17 0.3375928 0.2637745
18 0.3304306 0.2823427
19 0.3813969 0.3139455
20 0.3814063 0.2875726
21 0.1635995 0.1936426
22 0.1546703 0.1755459
23 0.1497812 0.1893369
24 0.1458645 0.1729330
25 0.1450000 0.1708971
26 0.1451275 0.1798791
27 0.1391878 0.1978126
28 0.1661801 0.1965980
29 0.1919833 0.1960416
30 0.2015131 0.2014474
31 0.1727551 0.1803966
32 0.1774746 0.1960130
$lv.coefs.median
coefficients
cols beta0 theta1 theta2 Dispersion
Abra alba 2.19785384 1.988463626 0.000000000 0.8049710
Abra sp. -1.60785043 1.859713408 0.688985905 20.2173666
Actiniaria -2.57492065 1.839207008 -0.432658357 16.3006332
Alitta succinea 1.28739235 2.962040553 -0.272685187 5.9091138
Ampelisca diadema 3.91611800 0.202992064 -2.458107574 1.8919712
Amphibalanus improvisus 1.24302352 2.971930903 0.827067343 1.1337970
Ampithoe sp. 0.44422404 0.909656274 -1.998454321 10.0143324
Anadara kagoshimensis -2.47575780 1.030848599 2.127959386 15.7072938
Apherusa bispinosa -2.42777879 -1.186346054 0.306714995 15.8312141
Apseudopsis ostroumovi 0.52069614 -5.652683931 -2.381105240 2.0290136
Bittium reticulatum 5.33821195 -2.188296167 2.471152642 0.8462873
Brachynotus sexdentatus -1.43275605 0.671639149 -0.198325734 14.8845937
Capitella capitata 1.07625034 -5.387945211 -0.927957946 1.1697129
Capitella minima 4.47866745 0.927828377 -2.811702014 0.8264542
Chamelea gallina -0.32847134 -3.872079785 0.432330906 0.5314599
Chironomidae larvae -2.27627590 -2.524457814 -2.237411662 11.8214047
Cumella limicola 0.89602581 -4.777192764 -0.003909736 0.4359523
Cumella pygmaea -1.92692093 -2.436270797 1.320853343 12.8210486
Cytharella costulata -0.06918885 -0.433108439 -0.631817500 1.3645580
Diogenes pugilator -0.17702978 0.967901057 -2.015034852 0.4227392
Eteone flava -2.88462586 1.638834488 -2.340887944 15.5943644
Eunice vittata -0.77938064 1.004839633 -1.600713823 16.3721423
Eurydice dollfusi -1.46534113 -2.008583562 0.878631692 15.6259966
Exogone naidina -0.46231222 0.723359263 -3.254358766 15.9232624
Gastrosaccus sanctus -2.36760458 -1.359591189 0.508017217 16.8261485
Genetyllis tuberculata 0.29313773 0.004613975 0.259084557 10.3338149
Glycera sp. -0.74025745 2.095496915 0.024122863 5.5252360
Glycera tridactyla -1.04090148 1.003043530 2.501384290 12.6891993
Glycera unicornis -2.42746001 0.848742769 1.843749657 15.8241885
Harmothoe imbricata -0.65275195 0.191966135 3.195701629 5.9202590
Harmothoe reticulata 0.46198922 0.414995827 -0.246837664 0.9583771
Heteromastus filiformis 3.94477843 0.050460508 0.370152319 0.6248417
Hirudinea -1.13299662 0.182770515 0.720298897 11.0831905
Hydrobia acuta -1.41775138 2.777511939 -0.306523317 21.0315014
Hydrobia sp. -0.57701622 2.064729591 -0.425678939 18.1683813
Iphinoe tenella 0.35193649 -0.092973228 0.673030600 6.8589879
Kellia suborbicularis -0.36271897 -3.112249152 4.064857708 3.1940592
Lagis koreni 1.06163168 -0.468884269 3.133340010 0.2783243
Leiochone leiopygos 0.31832355 -1.763839564 3.210371962 0.4975771
Lentidium mediterraneum -2.09709664 -2.122354336 0.080461836 11.6186072
Lepidochitona cinerea -2.44289992 -1.417973748 0.272856397 15.5449148
Loripes orbiculatus 1.92208361 -2.100947705 0.407646541 0.3970641
Lucinella divaricata -1.08559649 -2.793913342 0.848272387 19.6694384
Magelona papillicornis -2.59176992 -1.498082094 -0.331266157 16.8718324
Maldane glebifex -2.50717000 1.761275610 -0.176802322 16.3263454
Melinna palmata 0.65235019 2.693794074 -1.235663150 2.7088214
Microdeutopus gryllotalpa 1.94100174 0.402465759 -2.479615959 0.5458825
Micromaldane ornithochaeta -0.85996151 -0.847378600 -1.357449211 15.1694240
Micronephthys stammeri -1.68067796 0.373874281 -1.377136299 15.5214322
Microphthalmus fragilis -1.19933295 -0.311281593 2.807656967 21.5380738
Microphthalmus sp. -1.67762648 -4.062668638 -2.984035175 5.7752110
Monocorophium acherusicum 2.03590220 2.348588824 -3.209772024 1.0582620
Mytilaster lineatus 3.45792486 -2.876999451 -0.639190554 1.9895849
Mytilus galloprovincialis -2.44007336 1.172493110 2.083606770 16.3996400
Nemertea 1.88539982 -0.349466806 1.127786695 0.6410157
Nephtys cirrosa -1.85773353 -1.029003345 1.938683312 11.7410516
Nephtys kersivalensis -2.40554056 0.798954731 2.017808179 15.6776487
Nereis perivisceralis -2.43748447 -1.340534174 0.676112949 16.1789847
Nereis pulsatoria -0.67325102 2.932654421 1.366148789 20.3085375
Nototropis guttatus 0.55164072 0.331233431 -1.832712963 6.9021396
Oligochaeta 4.78438467 -1.839144882 0.190284877 1.0896891
Paradoneis harpagonea -2.67555929 2.076419665 -0.391386610 15.4219440
Parthenina interstincta -0.08837407 0.859012747 3.071496088 13.9477704
Parvicardium exiguum 2.38704769 0.840492912 -0.939434983 1.5860439
Perinereis cultrifera 0.50722797 -0.113276157 -1.661157517 6.6539819
Perioculodes longimanus -0.35461154 1.073104957 -2.669625323 1.4713613
Phoronida 0.41760970 -0.104778373 0.768798648 0.9834810
Phyllodoce sp. -3.01981147 1.596551836 -2.444205912 13.6076223
Platyhelminthes 0.13642659 2.048823379 1.017446701 5.2682532
Platynereis dumerilii 1.16015160 0.817979459 -3.257402370 0.5335618
Polititapes aureus -0.31097101 -0.003484991 0.207726167 8.1663775
Polychaeta larvae -2.47603970 1.324432120 -2.127596234 17.3670259
Polydora ciliata 3.32112980 2.466116318 -0.944469824 3.7356192
Polygordius neapolitanus -2.56195317 1.459549278 -2.102209971 16.5777513
Prionospio cirrifera 3.66074027 1.110737308 -0.631746535 3.9722533
Protodorvillea kefersteini 1.71157203 -2.163161586 0.212721440 2.1815886
Pseudocuma longicorne -1.18696326 0.060398177 -0.649119276 12.1140016
Rissoa membranacea 3.07439563 0.352262377 -1.467873444 1.2519720
Rissoa splendida -1.17722111 -1.452549534 -3.971575523 2.2130822
Salvatoria clavata -1.10721178 -2.063578713 -4.812044163 0.6526493
Schistomeringos rudolphi 0.40689157 -1.531835423 4.380316397 5.7291662
Sphaerosyllis hystrix -0.25157797 -3.319628032 0.507520309 0.7323123
Spio filicornis 1.88379434 2.108241421 -2.789507711 3.2010708
Spisula subtruncata -1.82096345 -2.397279978 -0.363378203 6.6088708
Stenosoma capito 1.03034336 -1.189778736 -1.260055108 2.0917511
Syllis gracilis 1.41729076 -2.384665252 0.383384781 2.7452947
Syllis hyalina -1.88202169 -2.749485641 -2.333898090 19.7876482
Tellina tenuis -1.53983938 -1.725232702 1.251688339 8.3971338
Thracia phaseolina -2.34756969 -1.154151061 0.295338210 15.2506244
Tricolia pullus -1.54997095 -3.068171792 -2.263533960 1.1431815
Tritia neritea -0.96870731 1.676180384 -1.192815379 14.4417006
Tritia reticulata 0.14673746 0.035142990 1.051822962 5.4930554
Turbellaria 0.39257972 0.926724416 -0.384149662 14.9254496
Upogebia pusilla -2.29158763 -2.750765842 -2.772528339 12.5455419
$lv.coefs.mean
coefficients
cols beta0 theta1 theta2 Dispersion
Abra alba 2.13888242 2.02494625 0.00000000 0.9039173
Abra sp. -1.63614385 1.75279647 0.97142025 18.6727291
Actiniaria -2.61691521 1.83563066 -0.38826425 15.6964942
Alitta succinea 1.27330705 2.97102401 -0.27829396 6.9202135
Ampelisca diadema 3.99744372 0.17748317 -2.48003918 1.9332675
Amphibalanus improvisus 1.18019865 3.03403850 0.84069872 1.3428220
Ampithoe sp. 0.55633234 0.79654712 -1.96331669 11.4652721
Anadara kagoshimensis -2.48350809 0.96992778 2.04536933 15.3976554
Apherusa bispinosa -2.41244794 -1.22135701 0.37263671 15.7457503
Apseudopsis ostroumovi 0.49208744 -5.70863561 -2.28849423 2.3600226
Bittium reticulatum 5.35959523 -2.24730129 2.55918054 0.9033090
Brachynotus sexdentatus -1.44045430 0.71450878 -0.16686466 14.9694399
Capitella capitata 1.05728907 -5.42994083 -0.87630932 1.3938653
Capitella minima 4.56671016 0.87007774 -2.83628957 0.8594013
Chamelea gallina -0.38157154 -3.96601798 0.51825881 0.7698886
Chironomidae larvae -2.31951167 -2.51358057 -2.19059104 13.1020303
Cumella limicola 0.83675508 -4.87676707 0.04294569 0.5384529
Cumella pygmaea -1.88064913 -2.56142723 1.43828440 13.8255181
Cytharella costulata -0.05882865 -0.48180355 -0.66912987 2.0659951
Diogenes pugilator -0.13633737 0.93693479 -2.05136643 0.6737253
Eteone flava -2.99229869 1.53699739 -2.31783334 15.4939745
Eunice vittata -0.76588621 1.01639552 -1.60645517 16.4582150
Eurydice dollfusi -1.47196222 -2.01138668 0.90735311 15.5689613
Exogone naidina -0.48294438 0.52010549 -3.32160700 16.2985359
Gastrosaccus sanctus -2.40283476 -1.38151330 0.68616297 16.3949157
Genetyllis tuberculata 0.38774851 -0.11126205 0.34466805 11.6708837
Glycera sp. -0.72870491 2.16396196 0.12494862 7.7066628
Glycera tridactyla -1.03897216 0.99173487 2.56730843 13.3599830
Glycera unicornis -2.43381225 0.72508900 1.86813130 15.7380205
Harmothoe imbricata -0.68041216 0.16257029 3.20702790 7.9044696
Harmothoe reticulata 0.45852799 0.42236334 -0.22853450 1.2825044
Heteromastus filiformis 3.91591236 0.05721122 0.38292614 0.6521842
Hirudinea -1.07870446 0.09742850 0.79375154 12.4477758
Hydrobia acuta -1.44972993 2.70916244 -0.27589184 20.1742310
Hydrobia sp. -0.55746024 2.03740809 -0.48343156 17.2761200
Iphinoe tenella 0.36024416 -0.18870566 0.72218584 8.2563751
Kellia suborbicularis -0.40709548 -3.22436862 4.10064828 4.4519858
Lagis koreni 1.04018203 -0.45308851 3.17096151 0.3874220
Leiochone leiopygos 0.30437090 -1.84902163 3.28439193 0.6844694
Lentidium mediterraneum -2.08118928 -2.18501713 0.13923598 12.7547575
Lepidochitona cinerea -2.45175689 -1.39125011 0.37171860 15.5880532
Loripes orbiculatus 1.92939497 -2.14023283 0.43005116 0.4672440
Lucinella divaricata -1.00438545 -2.81804701 0.87379479 18.8822750
Magelona papillicornis -2.56498980 -1.56190133 -0.19242780 16.2717609
Maldane glebifex -2.52889599 1.83059763 -0.02024547 15.9828841
Melinna palmata 0.64945353 2.69508273 -1.14664335 3.2922037
Microdeutopus gryllotalpa 1.99658067 0.35328420 -2.53398369 0.6119471
Micromaldane ornithochaeta -0.79103597 -0.88253230 -1.37554571 15.5757177
Micronephthys stammeri -1.69144296 0.39039090 -1.44368389 15.3044118
Microphthalmus fragilis -1.13141238 -0.28718852 2.87945334 20.4531157
Microphthalmus sp. -1.66863907 -4.10662368 -2.94165369 8.2221069
Monocorophium acherusicum 2.12001088 2.31674117 -3.21337569 1.1330927
Mytilaster lineatus 3.49852852 -2.91783090 -0.67097169 2.0912247
Mytilus galloprovincialis -2.50167256 1.06226298 2.06647164 15.8776622
Nemertea 1.88145093 -0.33446599 1.16562956 0.7217569
Nephtys cirrosa -1.82148290 -1.01085410 1.86246646 12.7306172
Nephtys kersivalensis -2.44922572 0.86028687 2.03865338 15.5595031
Nereis perivisceralis -2.43317574 -1.40614886 0.73849112 15.8334611
Nereis pulsatoria -0.73434139 2.89637927 1.37981303 19.4158083
Nototropis guttatus 0.55724421 0.26691501 -1.84699017 8.2991262
Oligochaeta 4.79216965 -1.84381606 0.18140206 1.1534712
Paradoneis harpagonea -2.64922814 2.11201941 -0.29566204 15.1750542
Parthenina interstincta -0.09471252 0.79684063 3.08515966 14.4550338
Parvicardium exiguum 2.39572190 0.87939653 -0.92583614 1.6741525
Perinereis cultrifera 0.53136124 -0.20341225 -1.69893187 8.0125837
Perioculodes longimanus -0.36662280 1.08770077 -2.70897377 2.2195308
Phoronida 0.42052141 -0.09234935 0.82955169 1.2652158
Phyllodoce sp. -3.06912192 1.54986514 -2.39796130 14.3551043
Platyhelminthes 0.11430015 2.03070844 1.06486419 6.5782785
Platynereis dumerilii 1.24539208 0.81537819 -3.29740916 0.6399393
Polititapes aureus -0.27442625 -0.07188488 0.32818238 10.0623815
Polychaeta larvae -2.54562332 1.23347798 -2.18082502 16.5368246
Polydora ciliata 3.33321377 2.54083029 -0.97380108 3.9217161
Polygordius neapolitanus -2.63386567 1.41497935 -2.08582346 15.9234465
Prionospio cirrifera 3.63467244 1.12618223 -0.69821552 4.2099250
Protodorvillea kefersteini 1.72653309 -2.18891654 0.18882661 2.5229508
Pseudocuma longicorne -1.10514791 0.06606452 -0.55756864 13.0709803
Rissoa membranacea 3.11280969 0.32794985 -1.49665055 1.3130619
Rissoa splendida -1.19806473 -1.57123744 -4.08526044 3.4369975
Salvatoria clavata -1.12281037 -2.17559340 -4.96247687 1.0681004
Schistomeringos rudolphi 0.40546260 -1.54942598 4.42012037 7.1735283
Sphaerosyllis hystrix -0.30251270 -3.44942653 0.64222669 0.9804908
Spio filicornis 1.93472074 2.05632022 -2.75283745 3.5185236
Spisula subtruncata -1.83723210 -2.40962910 -0.39375058 9.0452528
Stenosoma capito 1.04762649 -1.19526377 -1.27471875 2.3580923
Syllis gracilis 1.43969512 -2.43665831 0.40281363 3.0307861
Syllis hyalina -1.91753021 -2.78946204 -2.40352748 19.0917971
Tellina tenuis -1.50907108 -1.76290479 1.30656718 10.3945381
Thracia phaseolina -2.32770483 -1.15281135 0.37623343 15.1814811
Tricolia pullus -1.60296285 -3.14189463 -2.22543721 2.1314467
Tritia neritea -0.90843064 1.65224285 -1.11739715 14.8590041
Tritia reticulata 0.17054963 0.03729649 1.16150200 6.7376552
Turbellaria 0.43410942 0.93798195 -0.44609534 15.6575233
Upogebia pusilla -2.28735451 -2.79857754 -2.69501945 13.5721286
$lv.coefs.iqr
coefficients
cols beta0 theta1 theta2 Dispersion
Abra alba 0.8077718 1.0304495 0.0000000 0.6944417
Abra sp. 2.2540322 3.5763103 1.1058444 12.2132470
Actiniaria 2.0135406 3.1539725 3.5024252 14.6414074
Alitta succinea 1.2588026 1.7139592 1.7605044 4.6901903
Ampelisca diadema 0.9445275 1.2002051 0.8861738 0.6844487
Amphibalanus improvisus 1.1092383 1.2929724 1.3665669 0.9631551
Ampithoe sp. 1.2965022 2.3757460 1.7934464 8.9749888
Anadara kagoshimensis 1.9610874 3.1653365 3.2135613 15.1911347
Apherusa bispinosa 1.9346152 3.5639949 3.5583306 14.1958141
Apseudopsis ostroumovi 1.0299062 2.1971343 2.3589039 1.4836592
Bittium reticulatum 0.6060192 1.0460018 1.2398800 0.3620446
Brachynotus sexdentatus 1.6599766 2.6135836 3.0208975 13.9390023
Capitella capitata 1.0793509 1.6969070 1.8833356 1.0376971
Capitella minima 0.9462612 1.1373776 0.9665959 0.3487353
Chamelea gallina 0.8372801 1.8031965 1.8231069 0.7249800
Chironomidae larvae 1.8967481 3.0369404 2.8699567 14.7808384
Cumella limicola 0.8392596 1.5776756 1.7409301 0.5035917
Cumella pygmaea 1.7067564 2.8466841 3.4567275 14.2059702
Cytharella costulata 0.7755900 1.3111660 1.3605542 2.1056688
Diogenes pugilator 0.9829196 1.1719971 1.0649103 0.7396731
Eteone flava 2.4711481 3.2582702 2.7222001 15.2432277
Eunice vittata 1.6914053 2.3099629 2.8262074 13.9317893
Eurydice dollfusi 1.6836070 3.2775192 3.3949566 13.6076075
Exogone naidina 1.6740535 3.1661563 2.4348108 11.9380552
Gastrosaccus sanctus 2.0261497 3.5082370 3.4269858 13.9227408
Genetyllis tuberculata 1.1731400 2.3994804 1.8661358 9.3463257
Glycera sp. 1.2737038 2.0484646 2.1532391 8.6122500
Glycera tridactyla 1.7029519 2.8407708 3.0902686 12.8021393
Glycera unicornis 2.0413318 3.4036766 3.3136065 14.1695923
Harmothoe imbricata 1.2915250 2.6097106 2.6100673 8.6488703
Harmothoe reticulata 0.7458101 1.1338388 1.1189780 1.3308373
Heteromastus filiformis 0.6178348 0.6152292 0.6293157 0.2623211
Hirudinea 1.4742449 2.7463893 2.6418280 14.3634015
Hydrobia acuta 2.0430084 2.9196522 3.4689480 10.0291567
Hydrobia sp. 1.7310303 2.4912074 3.2731602 13.1158066
Iphinoe tenella 0.9847199 2.2131061 2.0977872 6.4155572
Kellia suborbicularis 1.2806073 2.3748090 2.6267318 4.2371698
Lagis koreni 0.7888489 1.3773115 1.2851926 0.4025635
Leiochone leiopygos 0.8610489 1.7070016 1.8213552 0.6762818
Lentidium mediterraneum 1.7602359 2.9142245 3.2676259 15.2191966
Lepidochitona cinerea 2.0556550 3.1633930 3.5220440 14.0013844
Loripes orbiculatus 0.5703296 0.9120636 0.9686539 0.3656034
Lucinella divaricata 1.7568803 3.2228774 3.5865186 10.8744911
Magelona papillicornis 1.9556453 3.2635256 3.4418043 13.6699525
Maldane glebifex 1.9193178 3.2456566 3.3420779 14.0348865
Melinna palmata 0.9935666 1.6796262 1.4115756 2.6648394
Microdeutopus gryllotalpa 0.8569135 1.0395300 0.7651328 0.4269162
Micromaldane ornithochaeta 1.6280628 2.8196837 2.5771964 12.8939136
Micronephthys stammeri 1.6809213 2.8472356 3.1241337 14.7376100
Microphthalmus fragilis 1.9963919 3.8691929 3.2596675 10.2471433
Microphthalmus sp. 1.8504550 2.9197304 2.7555891 9.6973564
Monocorophium acherusicum 1.1358168 1.2785906 1.0608438 0.6077650
Mytilaster lineatus 0.6643706 1.1497128 1.3575011 0.8498367
Mytilus galloprovincialis 2.0240982 3.4580309 3.2668847 15.0458032
Nemertea 0.6248592 0.8761647 0.8771191 0.5067207
Nephtys cirrosa 1.6656881 3.1051659 3.0414807 14.3076043
Nephtys kersivalensis 2.0147372 3.5732922 3.4109915 15.3859008
Nereis perivisceralis 2.0584389 3.1260971 3.5560068 14.7663716
Nereis pulsatoria 2.0567647 3.1961618 2.9473474 11.8172201
Nototropis guttatus 1.1646901 1.7365468 2.0837510 6.0615746
Oligochaeta 0.5259047 0.8305961 0.8441557 0.4244848
Paradoneis harpagonea 2.1444022 2.9612037 3.2278836 15.1383733
Parthenina interstincta 1.5055468 2.6346828 3.0807665 11.8873072
Parvicardium exiguum 0.7850171 1.0750322 0.7483103 0.7293900
Perinereis cultrifera 1.0805323 1.6329966 2.1062774 6.1840593
Perioculodes longimanus 1.1032982 1.4716278 1.2378072 2.2119809
Phoronida 0.7594325 1.1630404 1.2804140 1.3019866
Phyllodoce sp. 2.2550550 3.0735605 2.9394432 15.9314172
Platyhelminthes 1.1563907 1.6487311 2.0807245 6.0944242
Platynereis dumerilii 0.9992105 1.2208925 0.9684694 0.5628459
Polititapes aureus 1.1458294 2.3230930 2.4226906 10.1367425
Polychaeta larvae 2.1619038 3.4823055 2.9956421 13.8947030
Polydora ciliata 1.0043883 1.3138186 1.4181004 1.8698192
Polygordius neapolitanus 2.1546835 3.2961698 3.0338104 14.4563501
Prionospio cirrifera 0.9502773 1.3963345 1.6280236 1.7239597
Protodorvillea kefersteini 0.6818089 1.2469220 1.7766697 1.6098308
Pseudocuma longicorne 1.5064578 2.3642233 2.7644187 13.4495182
Rissoa membranacea 0.8013119 0.9709186 0.7399376 0.4723165
Rissoa splendida 1.2503066 2.1301488 1.6836482 3.3194925
Salvatoria clavata 1.2646202 2.1061699 1.7758818 1.1461714
Schistomeringos rudolphi 1.2380350 2.4683331 2.8235987 5.8850475
Sphaerosyllis hystrix 0.8458007 1.8065492 1.8052376 1.0028242
Spio filicornis 1.1682502 1.8453695 1.4447831 1.7017632
Spisula subtruncata 1.5765267 2.7105547 2.9447013 11.0581671
Stenosoma capito 0.7967887 1.4746078 1.4427902 1.2922306
Syllis gracilis 0.8029568 1.6814493 1.4794253 1.5894228
Syllis hyalina 2.2488821 3.2611275 3.3268882 11.5860079
Tellina tenuis 1.4304167 3.0670900 3.0674947 12.1919540
Thracia phaseolina 1.8712442 3.1851556 3.3067078 15.2466140
Tricolia pullus 1.3467969 2.2993183 1.9832650 2.1179135
Tritia neritea 1.6338762 2.5048116 2.9800935 12.8432740
Tritia reticulata 1.0453193 1.9839105 2.2849369 5.4672029
Turbellaria 1.3468811 2.0611374 2.5864368 11.3982121
Upogebia pusilla 2.0364368 3.1703656 3.2171938 13.8653851
$lv.coefs.sd
coefficients
cols beta0 theta1 theta2 Dispersion
Abra alba 0.6179206 0.7341573 0.0000000 0.5547260
Abra sp. 1.7269819 2.7193223 0.8959785 7.7696513
Actiniaria 1.5748771 2.3530683 2.5557356 8.6548663
Alitta succinea 0.9770620 1.3625463 1.4226317 4.0693374
Ampelisca diadema 0.6048811 0.9247662 0.7037473 0.5106893
Amphibalanus improvisus 0.7691414 0.9560101 0.9997657 0.9212057
Ampithoe sp. 1.0822354 1.7884225 1.4307216 6.4905188
Anadara kagoshimensis 1.6159764 2.5030083 2.3982778 8.7951927
Apherusa bispinosa 1.4821613 2.5764010 2.5847672 8.5382822
Apseudopsis ostroumovi 0.8648580 1.7479676 1.6878551 1.3793725
Bittium reticulatum 0.4481639 0.8471717 0.9020066 0.2960943
Brachynotus sexdentatus 1.3100271 2.0084626 2.5095365 8.3060120
Capitella capitata 0.8018958 1.2985538 1.5027197 0.9647219
Capitella minima 0.6680849 0.8531485 0.6835401 0.2784175
Chamelea gallina 0.6940095 1.3874466 1.3469307 0.8420455
Chironomidae larvae 1.4780975 2.2933741 2.2941830 8.6470509
Cumella limicola 0.6335681 1.2139391 1.3361393 0.4429862
Cumella pygmaea 1.3537705 2.2778549 2.5775134 8.3677398
Cytharella costulata 0.5753893 1.0141772 1.0403629 2.2027991
Diogenes pugilator 0.6849581 0.9038170 0.8491618 0.7653291
Eteone flava 1.8528141 2.4883189 2.1624537 8.7578086
Eunice vittata 1.3143207 1.8637859 2.2095959 7.9688584
Eurydice dollfusi 1.2926469 2.4378341 2.6336105 8.1921475
Exogone naidina 1.2743444 2.4131870 1.8652715 7.2616760
Gastrosaccus sanctus 1.5612049 2.4978258 2.6553574 8.4078812
Genetyllis tuberculata 0.9435342 1.8690500 1.4779616 6.8902846
Glycera sp. 0.9709714 1.7162658 1.6620435 6.7831387
Glycera tridactyla 1.2972348 2.2866306 2.3967152 7.9713687
Glycera unicornis 1.5415704 2.5776893 2.5399018 8.3953916
Harmothoe imbricata 1.0588286 1.9606180 2.0622513 6.6690862
Harmothoe reticulata 0.5626646 0.9077461 0.9071224 1.1737408
Heteromastus filiformis 0.4540283 0.4914411 0.4739231 0.2101454
Hirudinea 1.1682084 2.1968187 2.1102681 8.4954456
Hydrobia acuta 1.6622399 2.4363711 2.6516021 6.6926237
Hydrobia sp. 1.3324880 1.8774994 2.4577814 7.8868605
Iphinoe tenella 0.8456904 1.7385084 1.6898866 5.4297621
Kellia suborbicularis 1.0277261 1.9203204 2.0481014 4.0017403
Lagis koreni 0.6509170 1.0550806 0.9409469 0.3587964
Leiochone leiopygos 0.6519512 1.2959249 1.3109019 0.6509516
Lentidium mediterraneum 1.3539198 2.1966293 2.4514373 8.7306384
Lepidochitona cinerea 1.5324638 2.4966328 2.6521245 8.5456789
Loripes orbiculatus 0.3959749 0.6927468 0.7799285 0.3124113
Lucinella divaricata 1.3763227 2.4777882 2.6776544 6.8400431
Magelona papillicornis 1.5565367 2.3381116 2.5928660 8.2944323
Maldane glebifex 1.5448785 2.4766086 2.5917259 8.3729674
Melinna palmata 0.7952699 1.3679320 1.1355752 2.4075626
Microdeutopus gryllotalpa 0.5839310 0.7465754 0.5832198 0.3727887
Micromaldane ornithochaeta 1.2617490 2.1376684 2.0555395 7.9878402
Micronephthys stammeri 1.3637490 2.1331429 2.4083291 8.5042296
Microphthalmus fragilis 1.5033577 2.7800848 2.4539419 6.7412717
Microphthalmus sp. 1.4920093 2.1236451 2.1042801 7.4568993
Monocorophium acherusicum 0.7560800 0.9833146 0.8344086 0.5115369
Mytilaster lineatus 0.4893444 1.0118652 1.0113182 0.6871337
Mytilus galloprovincialis 1.5895827 2.6292268 2.4474274 8.6117594
Nemertea 0.4720183 0.6896806 0.7003839 0.4234338
Nephtys cirrosa 1.3221287 2.2855199 2.3323289 8.6253573
Nephtys kersivalensis 1.5829312 2.6397244 2.5712667 8.8739685
Nereis perivisceralis 1.5660467 2.3688512 2.6245307 8.4236208
Nereis pulsatoria 1.4702990 2.3307387 2.3236206 7.1611983
Nototropis guttatus 0.8882552 1.3792482 1.7563265 5.3414875
Oligochaeta 0.3859186 0.5865456 0.6790956 0.3555510
Paradoneis harpagonea 1.6566954 2.3354595 2.5602696 8.6282503
Parthenina interstincta 1.1543617 2.0487979 2.3090967 7.3885945
Parvicardium exiguum 0.5514123 0.7976999 0.6096550 0.5844940
Perinereis cultrifera 0.8449069 1.3087897 1.6771366 5.2671665
Perioculodes longimanus 0.7900576 1.1596241 0.9765467 2.4041500
Phoronida 0.5718865 0.8893804 1.0249754 1.1170671
Phyllodoce sp. 1.8012534 2.3878749 2.1799716 8.9290385
Platyhelminthes 0.9304663 1.3697593 1.6409519 5.1219709
Platynereis dumerilii 0.6810220 0.9015320 0.7208040 0.4833017
Polititapes aureus 0.9144046 1.8825972 1.8877419 7.1997284
Polychaeta larvae 1.7593668 2.6309557 2.2660580 8.3103666
Polydora ciliata 0.7579670 1.0692822 1.1084382 1.4447361
Polygordius neapolitanus 1.7398891 2.5286733 2.3122050 8.4491657
Prionospio cirrifera 0.6802857 1.0458808 1.1931745 1.4564417
Protodorvillea kefersteini 0.5426101 0.9864639 1.4039943 1.4059962
Pseudocuma longicorne 1.2020334 1.8973242 2.2191991 8.3169721
Rissoa membranacea 0.5302404 0.7471367 0.5753379 0.3931313
Rissoa splendida 1.0318005 1.7065140 1.3939843 3.8760434
Salvatoria clavata 0.9811041 1.5626914 1.3611385 1.1832013
Schistomeringos rudolphi 1.0343874 1.9479129 2.1887793 5.1305187
Sphaerosyllis hystrix 0.6732918 1.3752817 1.3045463 0.9054008
Spio filicornis 0.8288796 1.3528050 1.0763145 1.5326535
Spisula subtruncata 1.2428276 2.1647286 2.2864516 7.8116135
Stenosoma capito 0.5739867 1.1329663 1.1181004 1.2450259
Syllis gracilis 0.5518862 1.2288917 1.1197247 1.4578930
Syllis hyalina 1.7656095 2.4193458 2.4116352 7.1813048
Tellina tenuis 1.1480275 2.2332793 2.3638641 8.1593453
Thracia phaseolina 1.4568604 2.5279476 2.5255955 8.7178708
Tricolia pullus 0.9675243 1.7187464 1.6238935 2.9683862
Tritia neritea 1.2748872 1.9417881 2.2863807 7.8401214
Tritia reticulata 0.8096867 1.5740717 1.7548478 5.0588477
Turbellaria 1.0467009 1.6020642 1.9419780 7.0924721
Upogebia pusilla 1.5692006 2.2812504 2.3562549 8.3759696
$row.coefs
$row.coefs[[1]]
$row.coefs[[1]]$median
1 2 3 4 5
-1.5607773 -0.9632179 -2.7394831 -0.9652821 -0.9995208
$row.coefs[[1]]$mean
1 2 3 4 5
-1.5330344 -0.9464873 -2.7323938 -0.9324430 -0.9980401
$row.coefs[[1]]$iqr
1 2 3 4 5
0.5409534 0.5820383 0.7628854 0.6816993 0.7356074
$row.coefs[[1]]$sd
1 2 3 4 5
0.3928366 0.3990326 0.5300180 0.4531568 0.5234757
$hpdintervals
$hpdintervals$lv
, , type = lower
lv
rows lv1 lv2
1 0.23292869 -0.82194469
2 0.21891986 -0.71798890
3 0.10447471 -0.98864250
4 0.14009828 -0.65729739
5 -0.04247357 -0.01552904
6 -0.10664364 0.04052210
7 -0.01108422 0.07577619
8 0.02877648 -0.17809693
9 0.01862386 -0.45758020
10 -0.06537411 -0.37882292
11 -0.40127107 -0.63335985
12 0.01616270 -0.38404551
13 -0.35058439 0.09667652
14 -0.12407609 -0.02198392
15 -0.25448407 0.03675943
16 -0.41607692 -0.05595725
17 -0.31660719 -1.40614023
18 -0.18413879 -1.39918931
19 -0.14830582 -1.72074955
20 -0.32644118 -1.66123691
21 -0.82412123 -0.54476415
22 -0.71035996 -0.31704279
23 -0.69332959 -0.41885082
24 -0.54775804 -0.28201333
25 -0.62333610 -0.36678655
26 -0.70621675 -0.22151172
27 -0.78458377 -0.26904734
28 -0.89084920 -0.25036404
29 -0.87465686 -0.96928203
30 -0.95038506 -1.00274346
31 -0.67700431 -0.66734502
32 -0.78463920 -0.78686401
, , type = upper
lv
rows lv1 lv2
1 1.14170376 0.24079800
2 1.09207236 0.37173019
3 0.98516004 0.05199271
4 0.98329871 0.32829649
5 0.70224945 0.86313380
6 0.66175577 0.86209203
7 0.77801155 0.89910529
8 0.76063623 0.69005641
9 0.66717454 0.34439572
10 0.65068173 0.44310903
11 0.30646194 0.09398513
12 0.74149068 0.48895019
13 0.38719627 0.84058630
14 0.56498067 0.71770681
15 0.44234359 0.76644883
16 0.15903374 0.60397609
17 1.02681602 -0.38081570
18 1.15178564 -0.32178470
19 1.35585708 -0.55660524
20 1.10405383 -0.59383270
21 -0.20396495 0.17383039
22 -0.08687165 0.38229868
23 -0.11599517 0.30605377
24 0.01597480 0.40803590
25 -0.06386525 0.28338450
26 -0.15104229 0.47812561
27 -0.26485346 0.50890152
28 -0.21711919 0.51205506
29 -0.15077257 -0.24452804
30 -0.19180441 -0.27605208
31 -0.03290289 0.02279252
32 -0.10209206 -0.05334919
$hpdintervals$lv.coefs
, , type = lower
coefficients
cols beta0 theta1 theta2 Dispersion
Abra alba 0.93135368 0.69395297 0.0000000000 6.599801e-02
Abra sp. -4.93328339 -3.55698089 0.0009026882 4.000080e+00
Actiniaria -6.20667744 -2.68603715 -5.2148290137 7.890785e-01
Alitta succinea -0.64983087 0.23712271 -2.9857875381 9.207851e-01
Ampelisca diadema 3.01593209 -1.83657998 -4.0557211213 1.071973e+00
Amphibalanus improvisus -0.17895430 1.23380103 -1.2104510578 9.435485e-02
Ampithoe sp. -1.33524645 -3.08065247 -4.6585176250 2.058939e+00
Anadara kagoshimensis -5.81478098 -3.81666711 -2.7215550157 1.601287e+00
Apherusa bispinosa -5.33407609 -6.03444118 -4.5760288633 1.324696e+00
Apseudopsis ostroumovi -1.17766864 -9.31320124 -5.3151275527 4.373719e-01
Bittium reticulatum 4.55055217 -4.08162967 0.8198470038 4.645416e-01
Brachynotus sexdentatus -3.81802712 -2.82849021 -5.7091686479 2.396990e+00
Capitella capitata -0.41573772 -7.86096887 -3.9869592075 4.474075e-03
Capitella minima 3.54614402 -0.84824017 -4.2305100762 3.930415e-01
Chamelea gallina -1.62120350 -6.55743066 -1.9877939040 2.724228e-03
Chironomidae larvae -5.26598790 -6.97167667 -6.7818014050 1.097818e-01
Cumella limicola -0.37761799 -7.23930738 -2.1778401195 1.687386e-03
Cumella pygmaea -4.54872797 -7.02023545 -3.5903688721 6.397994e-01
Cytharella costulata -1.16335071 -2.63419341 -2.5960943867 2.748654e-03
Diogenes pugilator -1.39199154 -0.86517946 -3.7731525745 1.467822e-03
Eteone flava -6.53022348 -3.31045722 -7.0080166767 5.399786e-01
Eunice vittata -3.19174990 -2.44148654 -6.0055352376 3.723655e+00
Eurydice dollfusi -3.99066566 -6.33810180 -4.1547387665 2.489398e+00
Exogone naidina -3.17960668 -4.27550553 -6.7070009281 5.203934e+00
Gastrosaccus sanctus -5.66522583 -5.80785539 -4.1360604763 2.300937e+00
Genetyllis tuberculata -1.38390843 -3.86820621 -2.4779221126 2.010344e+00
Glycera sp. -2.67164026 -1.17565807 -2.9689647544 1.155972e-02
Glycera tridactyla -3.55909363 -3.52049543 -2.0704139725 9.541797e-01
Glycera unicornis -5.44034560 -4.57988830 -2.7517642751 2.292254e+00
Harmothoe imbricata -2.74313595 -3.71187088 -1.2788466315 2.226736e-03
Harmothoe reticulata -0.57543594 -1.41146714 -1.9322382345 9.370507e-05
Heteromastus filiformis 3.02473815 -0.86093526 -0.4535290622 3.101535e-01
Hirudinea -3.47128776 -4.09249707 -3.1638468615 1.604591e-01
Hydrobia acuta -4.50428251 -2.26127084 -5.4064056563 7.349489e+00
Hydrobia sp. -3.48957612 -1.70266281 -5.4552365710 3.685232e+00
Iphinoe tenella -1.40324872 -3.88150818 -2.5236814195 8.443675e-01
Kellia suborbicularis -2.36347500 -7.41568104 -0.3899770175 8.285002e-03
Lagis koreni -0.27691973 -2.37286768 1.5037555458 1.492204e-03
Leiochone leiopygos -0.97709619 -4.38993798 0.9603582813 6.355268e-03
Lentidium mediterraneum -4.95336423 -6.73896049 -4.7414336741 3.702229e-02
Lepidochitona cinerea -5.34812599 -6.06364941 -5.1756484560 1.713815e+00
Loripes orbiculatus 1.17359716 -3.52468889 -0.9876350450 1.735010e-02
Lucinella divaricata -3.52042139 -8.01534497 -3.7741248288 6.644234e+00
Magelona papillicornis -5.56007224 -6.59257239 -5.0062522595 2.181389e+00
Maldane glebifex -5.42267781 -2.99432974 -5.0260887262 2.390346e+00
Melinna palmata -0.93611297 -0.01189583 -3.4355901694 3.626634e-02
Microdeutopus gryllotalpa 0.94980861 -1.06256483 -3.7044950325 5.718521e-02
Micromaldane ornithochaeta -3.06232329 -5.26593201 -5.3207278023 3.129105e+00
Micronephthys stammeri -4.25846565 -3.90922459 -6.1112285046 9.357713e-01
Microphthalmus fragilis -4.18237282 -5.74148652 -1.7365237412 7.567979e+00
Microphthalmus sp. -4.77337819 -8.41766311 -6.7489981433 2.269304e-02
Monocorophium acherusicum 0.79164097 0.41891633 -4.7869913555 2.725585e-01
Mytilaster lineatus 2.64585603 -4.86652627 -2.8324285697 8.645731e-01
Mytilus galloprovincialis -5.89587952 -4.43737780 -2.7741234691 2.122127e+00
Nemertea 0.98427149 -1.77587582 -0.1213472828 4.249048e-02
Nephtys cirrosa -4.46026497 -5.81716903 -2.5743053446 6.301529e-03
Nephtys kersivalensis -5.56974297 -4.01340674 -3.1653836057 1.429294e+00
Nereis perivisceralis -5.28656783 -5.82144722 -4.2097329966 2.628135e+00
Nereis pulsatoria -3.51691654 -1.53917589 -3.1081968606 6.369624e+00
Nototropis guttatus -1.21468026 -2.60132235 -5.5424157848 9.909077e-01
Oligochaeta 4.09146020 -2.98521507 -1.1682713457 5.438464e-01
Paradoneis harpagonea -6.30025423 -2.40710878 -5.2935106086 1.270593e+00
Parthenina interstincta -2.26973330 -3.28671353 -1.7135494496 3.132267e+00
Parvicardium exiguum 1.33579509 -0.54703968 -2.2354798639 7.169506e-01
Perinereis cultrifera -1.14484191 -2.69379963 -4.8175445404 1.175520e+00
Perioculodes longimanus -1.90175878 -1.00035503 -4.6909167903 1.192765e-03
Phoronida -0.57774859 -1.83384582 -0.9369852644 8.534155e-04
Phyllodoce sp. -6.89758113 -3.02637122 -6.6628621167 3.853221e-01
Platyhelminthes -1.78314786 -0.47405802 -2.1053016889 1.854631e-01
Platynereis dumerilii 0.15996454 -0.77476101 -4.7414339546 1.216555e-03
Polititapes aureus -1.94630613 -3.78046118 -3.4284460943 4.448733e-02
Polychaeta larvae -5.79047761 -3.73503861 -6.5651036613 2.629540e+00
Polydora ciliata 1.85344674 0.34396155 -3.2052372570 1.616695e+00
Polygordius neapolitanus -6.28148180 -4.15718083 -6.2825248991 1.932298e+00
Prionospio cirrifera 2.23700950 -0.87894537 -3.0306760352 1.766141e+00
Protodorvillea kefersteini 0.71470576 -4.18638203 -2.5756653424 6.511765e-01
Pseudocuma longicorne -3.37512167 -3.43369094 -4.8569330236 1.436336e-01
Rissoa membranacea 2.11188846 -1.12536041 -2.5469398243 5.629835e-01
Rissoa splendida -3.12359075 -5.25585533 -7.2244334667 4.791006e-03
Salvatoria clavata -2.89255481 -5.23218424 -7.8856038489 4.570989e-04
Schistomeringos rudolphi -1.68291573 -5.41310681 0.2220915282 5.269437e-01
Sphaerosyllis hystrix -1.57747874 -6.24518614 -1.8268728602 4.301480e-03
Spio filicornis 0.48529291 -0.65702539 -4.7659825548 1.040910e+00
Spisula subtruncata -4.32313300 -6.73195588 -4.6756394305 8.575949e-03
Stenosoma capito 0.00841506 -3.23601154 -3.4331783095 5.302337e-01
Syllis gracilis 0.37569458 -4.93020449 -1.7127074920 1.081708e+00
Syllis hyalina -5.59332614 -7.72932913 -7.0555497635 6.506526e+00
Tellina tenuis -3.71583644 -5.92231262 -3.1460995668 2.604122e-02
Thracia phaseolina -5.26293758 -6.50217775 -4.1906798576 9.642613e-01
Tricolia pullus -3.45124822 -6.63392411 -5.5174098811 7.854921e-03
Tritia neritea -3.31699167 -2.30836241 -5.6202143748 2.404856e+00
Tritia reticulata -1.50969171 -3.08164335 -2.2941613148 4.128096e-01
Turbellaria -1.46414201 -2.27919726 -4.5472122754 4.224548e+00
Upogebia pusilla -5.58160423 -7.33796546 -6.8360274704 2.430044e-01
, , type = upper
coefficients
cols beta0 theta1 theta2 Dispersion
Abra alba 3.3197606 3.5645378 0.0000000 1.976909
Abra sp. 1.7226800 7.0121781 2.7566974 29.974889
Actiniaria 0.1792224 6.2177340 4.4228309 29.108536
Alitta succinea 3.1950994 5.6157629 2.4273088 14.745797
Ampelisca diadema 5.1614323 1.8238073 -1.1579983 2.960174
Amphibalanus improvisus 2.6046571 4.9659784 2.6987352 3.040911
Ampithoe sp. 2.6760656 3.8579294 1.0378502 24.975696
Anadara kagoshimensis 0.8665543 5.8171492 6.6931995 29.917469
Apherusa bispinosa 0.4869555 3.5080455 5.4817859 29.469136
Apseudopsis ostroumovi 2.3636254 -2.3563788 1.2223852 5.143912
Bittium reticulatum 6.2101514 -0.5995671 4.2590097 1.558321
Brachynotus sexdentatus 1.3330468 5.0596953 4.3566334 29.979605
Capitella capitata 2.6917506 -2.7563614 1.9095968 3.342419
Capitella minima 6.0176398 2.4776267 -1.6146435 1.423626
Chamelea gallina 1.1269001 -1.2116889 3.3191836 2.340091
Chironomidae larvae 0.5512231 2.0191462 2.2081978 27.745524
Cumella limicola 2.0189770 -2.5934611 3.0627129 1.305172
Cumella pygmaea 0.8190638 1.7604833 6.3195921 28.095591
Cytharella costulata 1.0173281 1.3674215 1.4076895 6.158779
Diogenes pugilator 1.1425094 2.6803757 -0.4070868 2.112171
Eteone flava 0.5772902 6.2737233 1.5931189 28.810042
Eunice vittata 1.9071270 4.7715223 2.5670558 29.849691
Eurydice dollfusi 1.2409188 2.9293265 5.9891445 29.836992
Exogone naidina 2.0038740 5.1156578 0.4409653 29.974801
Gastrosaccus sanctus 0.3903367 3.9410478 6.5224242 29.988260
Genetyllis tuberculata 2.1865903 3.4423451 3.6171705 27.090741
Glycera sp. 1.0687582 5.7493051 3.5284808 22.293641
Glycera tridactyla 1.5058664 5.7575407 7.3283992 28.241998
Glycera unicornis 0.6804678 5.6322599 7.3838996 29.910210
Harmothoe imbricata 1.5315707 3.7145459 6.8416256 21.893109
Harmothoe reticulata 1.5439608 2.0769663 1.6086929 3.730054
Heteromastus filiformis 4.7799436 1.0312328 1.4198749 1.108586
Hirudinea 1.1181332 4.7726220 5.1988738 27.753842
Hydrobia acuta 2.1783766 7.5179800 5.0572814 29.989080
Hydrobia sp. 1.8872469 5.6093893 4.1078983 29.933309
Iphinoe tenella 1.9829394 2.9368719 4.2920647 19.607836
Kellia suborbicularis 1.6731654 0.1357781 7.8896399 12.345176
Lagis koreni 2.3467228 1.8632398 5.0204543 1.096612
Leiochone leiopygos 1.5223817 0.5955029 5.8669703 2.009575
Lentidium mediterraneum 0.5023478 1.9292461 5.0871782 27.810662
Lepidochitona cinerea 0.7220257 4.0051651 5.2399700 29.857372
Loripes orbiculatus 2.6557056 -0.8699264 2.1235508 1.050349
Lucinella divaricata 1.8339136 1.8479387 6.9822060 29.787075
Magelona papillicornis 0.5119025 2.4399388 4.9501528 29.875577
Maldane glebifex 0.5274868 6.4510835 5.2135011 29.923588
Melinna palmata 2.0889788 5.3644373 0.9812852 7.649165
Microdeutopus gryllotalpa 3.0963473 1.7616995 -1.4326157 1.251763
Micromaldane ornithochaeta 1.7969152 3.1472728 2.8103118 29.940172
Micronephthys stammeri 1.1385447 4.2862899 3.1706291 28.879952
Microphthalmus fragilis 1.6361270 4.7939551 7.9489913 29.940053
Microphthalmus sp. 1.2474833 -0.2524266 1.3297215 24.480486
Monocorophium acherusicum 3.6258465 4.2641140 -1.4518093 2.160868
Mytilaster lineatus 4.5238079 -0.9076060 1.1005903 3.359699
Mytilus galloprovincialis 0.4890444 6.0601991 6.7014891 29.999734
Nemertea 2.8019617 0.9836751 2.6435071 1.542586
Nephtys cirrosa 0.7207251 3.1311315 6.3747781 27.640527
Nephtys kersivalensis 0.4067579 6.3455155 6.6776896 29.983413
Nereis perivisceralis 0.7060812 3.3699627 6.0908050 29.957390
Nereis pulsatoria 2.1004808 7.2288398 5.7588087 29.964603
Nototropis guttatus 2.2231547 2.8660047 1.5790043 19.613819
Oligochaeta 5.5941070 -0.7806772 1.5335991 1.829618
Paradoneis harpagonea 0.3441335 7.0005457 4.7262809 29.583742
Parthenina interstincta 2.1081351 4.7247564 7.1465968 29.198145
Parvicardium exiguum 3.3705743 2.6290818 0.2075728 2.885092
Perinereis cultrifera 2.1446200 2.2633266 1.6099145 19.393359
Perioculodes longimanus 1.0753820 3.6315489 -0.7982055 6.826097
Phoronida 1.5774166 1.6452499 3.1356161 3.384461
Phyllodoce sp. 0.1670279 6.3206142 1.7485095 28.761561
Platyhelminthes 1.9333640 5.2160605 4.1770984 17.051040
Platynereis dumerilii 2.6507128 2.6096868 -1.9402828 1.621257
Polititapes aureus 1.6621329 3.8858462 3.9442116 24.611347
Polychaeta larvae 1.4021273 6.0600633 2.1753616 29.967005
Polydora ciliata 4.7837898 4.6267739 1.0758848 6.892951
Polygordius neapolitanus 0.6088371 5.8923380 2.7329258 29.760870
Prionospio cirrifera 4.8226443 3.1209575 1.5388422 6.878124
Protodorvillea kefersteini 2.7960796 -0.3879756 2.8703220 5.408724
Pseudocuma longicorne 1.4374976 4.0882483 3.8746699 27.827786
Rissoa membranacea 4.0460372 1.8296713 -0.3268782 2.058737
Rissoa splendida 0.9707741 1.4093826 -1.6580596 11.031501
Salvatoria clavata 0.8723437 0.7227943 -2.7096110 3.588916
Schistomeringos rudolphi 2.3247152 2.4087365 8.9136816 17.949596
Sphaerosyllis hystrix 1.0577982 -0.9147981 3.2397818 2.806042
Spio filicornis 3.6556148 4.5136035 -0.5095093 6.661942
Spisula subtruncata 0.6758760 1.9174845 4.1907814 25.475998
Stenosoma capito 2.1400922 1.1675043 0.9170840 4.939115
Syllis gracilis 2.5231102 -0.2276065 2.7496755 5.937299
Syllis hyalina 1.4293439 1.5945567 2.1744217 29.988708
Tellina tenuis 0.5456396 2.6080885 5.9297081 26.969072
Thracia phaseolina 0.3842891 3.3702319 5.5699964 29.275729
Tricolia pullus 0.2044710 -0.2044962 1.1057326 7.742245
Tritia neritea 1.6673078 5.2949033 3.3046977 29.404724
Tritia reticulata 1.7229859 3.1557802 4.7834694 17.476177
Turbellaria 2.6051122 4.1715489 2.9780193 28.857069
Upogebia pusilla 0.5616703 1.3111608 2.2970976 28.219621
$hpdintervals$row.coefs
$hpdintervals$row.coefs[[1]]
lower upper
1 -2.241429 -0.75037346
2 -1.731546 -0.22037479
3 -3.660101 -1.67121377
4 -1.793684 -0.06723921
5 -1.986481 0.03685933
$call
boral.default(y = zoo.abnd.flt.zostera, family = "negative.binomial",
lv.control = list(num.lv = 2), row.eff = "fixed", row.ids = matrix(rep(1:5,
times = c(8, 8, 4, 8, 4)), ncol = 1))
$n
[1] 32
$p
[1] 94
$X.ind
numeric(0)
$y
$row.eff
[1] "fixed"
$row.ids
[,1]
[1,] 1
[2,] 1
[3,] 1
[4,] 1
[5,] 1
[6,] 1
[7,] 1
[8,] 1
[9,] 2
[10,] 2
[11,] 2
[12,] 2
[13,] 2
[14,] 2
[15,] 2
[16,] 2
[17,] 3
[18,] 3
[19,] 3
[20,] 3
[21,] 4
[22,] 4
[23,] 4
[24,] 4
[25,] 4
[26,] 4
[27,] 4
[28,] 4
[29,] 5
[30,] 5
[31,] 5
[32,] 5
$geweke.diag
$geweke.diag$geweke.diag
$geweke.diag$geweke.diag$lv.coefs
beta0 Disperson
Abra alba 2.110296367 0.30583945
Abra sp. -0.557686362 0.08600817
Actiniaria -0.317139957 0.51098099
Alitta succinea 1.777557277 -0.71919911
Ampelisca diadema 0.365079671 1.74591150
Amphibalanus improvisus 1.763951641 0.55654682
Ampithoe sp. -0.335884553 -0.78823183
Anadara kagoshimensis 1.602232678 -0.90871219
Apherusa bispinosa 1.628280309 1.40871665
Apseudopsis ostroumovi 0.416488899 1.07447579
Bittium reticulatum 0.845854806 0.62486284
Brachynotus sexdentatus 1.897747693 0.96495437
Capitella capitata 0.588103331 -0.24991175
Capitella minima 0.846923335 0.13500279
Chamelea gallina -0.705841477 0.13081255
Chironomidae larvae -0.197770967 -1.09115807
Cumella limicola 0.837578808 0.52899128
Cumella pygmaea -0.166191910 -0.49815395
Cytharella costulata 0.040436547 -0.89281552
Diogenes pugilator 1.662949186 -1.44027806
Eteone flava 0.150083881 0.72788939
Eunice vittata 0.260840174 0.52434590
Eurydice dollfusi 1.231698114 -0.27754535
Exogone naidina -2.298910099 0.22990753
Gastrosaccus sanctus 0.387692365 0.84749909
Genetyllis tuberculata -0.182311804 -0.40163810
Glycera sp. 0.238527682 -0.13812350
Glycera tridactyla -0.469155135 0.47080089
Glycera unicornis 0.544276861 1.34868118
Harmothoe imbricata 0.288224431 -2.28020254
Harmothoe reticulata 1.206081486 -0.48921610
Heteromastus filiformis 1.296987623 0.68041424
Hirudinea 0.842573600 -1.86388813
Hydrobia acuta -0.525476356 0.84119437
Hydrobia sp. -1.870674174 -0.49289037
Iphinoe tenella 0.978810388 -0.22037540
Kellia suborbicularis 0.638185344 1.02742536
Lagis koreni 1.940223417 0.29310519
Leiochone leiopygos 0.630744561 1.10132066
Lentidium mediterraneum -0.339921638 -1.20931724
Lepidochitona cinerea -0.002231745 -0.05112444
Loripes orbiculatus 0.996588429 -0.13778337
Lucinella divaricata -0.362655475 -0.62076791
Magelona papillicornis 0.631025566 2.21308555
Maldane glebifex 1.510811164 -0.61554130
Melinna palmata 1.524144158 -0.50190005
Microdeutopus gryllotalpa 1.731022923 -0.36193193
Micromaldane ornithochaeta 0.418686662 -0.17446177
Micronephthys stammeri 1.292467568 -0.99639061
Microphthalmus fragilis -0.238207804 -3.49575383
Microphthalmus sp. -0.581858964 -0.98985479
Monocorophium acherusicum 1.056394357 -1.42893677
Mytilaster lineatus 1.502313325 -0.29264260
Mytilus galloprovincialis 0.224285931 -0.14420054
Nemertea 2.100780277 0.04451835
Nephtys cirrosa 0.882747604 0.26596321
Nephtys kersivalensis -0.542445996 -0.76263349
Nereis perivisceralis 0.835726966 2.04241087
Nereis pulsatoria 0.464742015 0.22189388
Nototropis guttatus 0.799764547 1.40849471
Oligochaeta 0.311433818 -1.11395943
Paradoneis harpagonea 1.391451015 1.63431779
Parthenina interstincta -0.126967379 -0.12786202
Parvicardium exiguum 1.519866294 -0.03013348
Perinereis cultrifera -0.054229264 -1.50571985
Perioculodes longimanus 0.657582158 -0.84741762
Phoronida 0.975844104 -1.33286091
Phyllodoce sp. -0.338039801 0.24770039
Platyhelminthes -0.017730472 -0.43180585
Platynereis dumerilii 1.060335167 -1.09722980
Polititapes aureus 2.092245769 0.83279777
Polychaeta larvae 1.323481602 1.10565396
Polydora ciliata 1.829791580 -1.05162540
Polygordius neapolitanus 0.256242551 1.15792022
Prionospio cirrifera 0.912871835 -0.51879750
Protodorvillea kefersteini -0.795002922 -0.32016043
Pseudocuma longicorne 0.729013541 -1.10140691
Rissoa membranacea 2.312290185 0.94287188
Rissoa splendida 0.112959686 -0.71515020
Salvatoria clavata 1.770682170 -0.94909715
Schistomeringos rudolphi 0.601123224 0.28528790
Sphaerosyllis hystrix 0.002225423 1.09909300
Spio filicornis 0.920675899 0.34609942
Spisula subtruncata 2.131600137 -0.08218578
Stenosoma capito -0.419009313 -0.51613700
Syllis gracilis -0.933227218 -1.16620835
Syllis hyalina 0.046552064 1.60408560
Tellina tenuis -0.835424039 0.01540871
Thracia phaseolina 0.611076602 0.68992007
Tricolia pullus -0.876044814 0.81014737
Tritia neritea -0.608231361 0.44573152
Tritia reticulata 2.574671896 -1.17307789
Turbellaria 1.983974647 -0.55700064
Upogebia pusilla -2.078869648 1.07465115
$geweke.diag$geweke.diag$row.coefs
$geweke.diag$geweke.diag$row.coefs[[1]]
row.coefs.ID1[1] row.coefs.ID1[2] row.coefs.ID1[3] row.coefs.ID1[4] row.coefs.ID1[5]
-1.576104 -1.549594 -1.194765 -1.696688 -1.533687
$geweke.diag$prop.exceed
FALSE TRUE
0.93264249 0.06735751
$family
[1] "negative.binomial" "negative.binomial" "negative.binomial" "negative.binomial"
[5] "negative.binomial" "negative.binomial" "negative.binomial" "negative.binomial"
[9] "negative.binomial" "negative.binomial" "negative.binomial" "negative.binomial"
[13] "negative.binomial" "negative.binomial" "negative.binomial" "negative.binomial"
[17] "negative.binomial" "negative.binomial" "negative.binomial" "negative.binomial"
[21] "negative.binomial" "negative.binomial" "negative.binomial" "negative.binomial"
[25] "negative.binomial" "negative.binomial" "negative.binomial" "negative.binomial"
[29] "negative.binomial" "negative.binomial" "negative.binomial" "negative.binomial"
[33] "negative.binomial" "negative.binomial" "negative.binomial" "negative.binomial"
[37] "negative.binomial" "negative.binomial" "negative.binomial" "negative.binomial"
[41] "negative.binomial" "negative.binomial" "negative.binomial" "negative.binomial"
[45] "negative.binomial" "negative.binomial" "negative.binomial" "negative.binomial"
[49] "negative.binomial" "negative.binomial" "negative.binomial" "negative.binomial"
[53] "negative.binomial" "negative.binomial" "negative.binomial" "negative.binomial"
[57] "negative.binomial" "negative.binomial" "negative.binomial" "negative.binomial"
[61] "negative.binomial" "negative.binomial" "negative.binomial" "negative.binomial"
[65] "negative.binomial" "negative.binomial" "negative.binomial" "negative.binomial"
[69] "negative.binomial" "negative.binomial" "negative.binomial" "negative.binomial"
[73] "negative.binomial" "negative.binomial" "negative.binomial" "negative.binomial"
[77] "negative.binomial" "negative.binomial" "negative.binomial" "negative.binomial"
[81] "negative.binomial" "negative.binomial" "negative.binomial" "negative.binomial"
[85] "negative.binomial" "negative.binomial" "negative.binomial" "negative.binomial"
[89] "negative.binomial" "negative.binomial" "negative.binomial" "negative.binomial"
[93] "negative.binomial" "negative.binomial"
$num.lv
[1] 2
$lv.control
$lv.control$num.lv
[1] 2
$lv.control$type
[1] "independent"
$num.X
[1] 0
$num.traits
[1] 0
$calc.ics
[1] FALSE
$trial.size
[1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[43] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[85] 0 0 0 0 0 0 0 0 0 0
$prior.control
$prior.control$type
[1] "normal" "normal" "normal" "uniform"
$prior.control$hypparams
[1] 10 10 10 30
$prior.control$ssvs.index
[1] -1
$prior.control$ssvs.g
[1] 1e-06
$prior.control$ssvs.traitsindex
[1] -1
$num.ord.levels
[1] 0
$mcmc.control
$mcmc.control$n.burnin
[1] 10000
$mcmc.control$n.iteration
[1] 40000
$mcmc.control$n.thin
[1] 30
$mcmc.control$seed
[1] 123
$format
[1] FALSE
attr(,"class")
[1] "boral"
Check the summary and diagnostic plots for the LVM.
summary(lvm.zostera)
$call
boral.default(y = zoo.abnd.flt.zostera, family = "negative.binomial",
lv.control = list(num.lv = 2), row.eff = "fixed", row.ids = matrix(rep(1:5,
times = c(8, 8, 4, 8, 4)), ncol = 1))
$coefficients
coefficients
cols beta0 theta1 theta2 Dispersion
Abra alba 2.198 1.988 0.000 0.805
Abra sp. -1.608 1.860 0.689 20.217
Actiniaria -2.575 1.839 -0.433 16.301
Alitta succinea 1.287 2.962 -0.273 5.909
Ampelisca diadema 3.916 0.203 -2.458 1.892
Amphibalanus improvisus 1.243 2.972 0.827 1.134
Ampithoe sp. 0.444 0.910 -1.998 10.014
Anadara kagoshimensis -2.476 1.031 2.128 15.707
Apherusa bispinosa -2.428 -1.186 0.307 15.831
Apseudopsis ostroumovi 0.521 -5.653 -2.381 2.029
Bittium reticulatum 5.338 -2.188 2.471 0.846
Brachynotus sexdentatus -1.433 0.672 -0.198 14.885
Capitella capitata 1.076 -5.388 -0.928 1.170
Capitella minima 4.479 0.928 -2.812 0.826
Chamelea gallina -0.328 -3.872 0.432 0.531
Chironomidae larvae -2.276 -2.524 -2.237 11.821
Cumella limicola 0.896 -4.777 -0.004 0.436
Cumella pygmaea -1.927 -2.436 1.321 12.821
Cytharella costulata -0.069 -0.433 -0.632 1.365
Diogenes pugilator -0.177 0.968 -2.015 0.423
Eteone flava -2.885 1.639 -2.341 15.594
Eunice vittata -0.779 1.005 -1.601 16.372
Eurydice dollfusi -1.465 -2.009 0.879 15.626
Exogone naidina -0.462 0.723 -3.254 15.923
Gastrosaccus sanctus -2.368 -1.360 0.508 16.826
Genetyllis tuberculata 0.293 0.005 0.259 10.334
Glycera sp. -0.740 2.095 0.024 5.525
Glycera tridactyla -1.041 1.003 2.501 12.689
Glycera unicornis -2.427 0.849 1.844 15.824
Harmothoe imbricata -0.653 0.192 3.196 5.920
Harmothoe reticulata 0.462 0.415 -0.247 0.958
Heteromastus filiformis 3.945 0.050 0.370 0.625
Hirudinea -1.133 0.183 0.720 11.083
Hydrobia acuta -1.418 2.778 -0.307 21.032
Hydrobia sp. -0.577 2.065 -0.426 18.168
Iphinoe tenella 0.352 -0.093 0.673 6.859
Kellia suborbicularis -0.363 -3.112 4.065 3.194
Lagis koreni 1.062 -0.469 3.133 0.278
Leiochone leiopygos 0.318 -1.764 3.210 0.498
Lentidium mediterraneum -2.097 -2.122 0.080 11.619
Lepidochitona cinerea -2.443 -1.418 0.273 15.545
Loripes orbiculatus 1.922 -2.101 0.408 0.397
Lucinella divaricata -1.086 -2.794 0.848 19.669
Magelona papillicornis -2.592 -1.498 -0.331 16.872
Maldane glebifex -2.507 1.761 -0.177 16.326
Melinna palmata 0.652 2.694 -1.236 2.709
Microdeutopus gryllotalpa 1.941 0.402 -2.480 0.546
Micromaldane ornithochaeta -0.860 -0.847 -1.357 15.169
Micronephthys stammeri -1.681 0.374 -1.377 15.521
Microphthalmus fragilis -1.199 -0.311 2.808 21.538
Microphthalmus sp. -1.678 -4.063 -2.984 5.775
Monocorophium acherusicum 2.036 2.349 -3.210 1.058
Mytilaster lineatus 3.458 -2.877 -0.639 1.990
Mytilus galloprovincialis -2.440 1.172 2.084 16.400
Nemertea 1.885 -0.349 1.128 0.641
Nephtys cirrosa -1.858 -1.029 1.939 11.741
Nephtys kersivalensis -2.406 0.799 2.018 15.678
Nereis perivisceralis -2.437 -1.341 0.676 16.179
Nereis pulsatoria -0.673 2.933 1.366 20.309
Nototropis guttatus 0.552 0.331 -1.833 6.902
Oligochaeta 4.784 -1.839 0.190 1.090
Paradoneis harpagonea -2.676 2.076 -0.391 15.422
Parthenina interstincta -0.088 0.859 3.071 13.948
Parvicardium exiguum 2.387 0.840 -0.939 1.586
Perinereis cultrifera 0.507 -0.113 -1.661 6.654
Perioculodes longimanus -0.355 1.073 -2.670 1.471
Phoronida 0.418 -0.105 0.769 0.983
Phyllodoce sp. -3.020 1.597 -2.444 13.608
Platyhelminthes 0.136 2.049 1.017 5.268
Platynereis dumerilii 1.160 0.818 -3.257 0.534
Polititapes aureus -0.311 -0.003 0.208 8.166
Polychaeta larvae -2.476 1.324 -2.128 17.367
Polydora ciliata 3.321 2.466 -0.944 3.736
Polygordius neapolitanus -2.562 1.460 -2.102 16.578
Prionospio cirrifera 3.661 1.111 -0.632 3.972
Protodorvillea kefersteini 1.712 -2.163 0.213 2.182
Pseudocuma longicorne -1.187 0.060 -0.649 12.114
Rissoa membranacea 3.074 0.352 -1.468 1.252
Rissoa splendida -1.177 -1.453 -3.972 2.213
Salvatoria clavata -1.107 -2.064 -4.812 0.653
Schistomeringos rudolphi 0.407 -1.532 4.380 5.729
Sphaerosyllis hystrix -0.252 -3.320 0.508 0.732
Spio filicornis 1.884 2.108 -2.790 3.201
Spisula subtruncata -1.821 -2.397 -0.363 6.609
Stenosoma capito 1.030 -1.190 -1.260 2.092
Syllis gracilis 1.417 -2.385 0.383 2.745
Syllis hyalina -1.882 -2.749 -2.334 19.788
Tellina tenuis -1.540 -1.725 1.252 8.397
Thracia phaseolina -2.348 -1.154 0.295 15.251
Tricolia pullus -1.550 -3.068 -2.264 1.143
Tritia neritea -0.969 1.676 -1.193 14.442
Tritia reticulata 0.147 0.035 1.052 5.493
Turbellaria 0.393 0.927 -0.384 14.925
Upogebia pusilla -2.292 -2.751 -2.773 12.546
$lvs
lv
rows lv1 lv2
1 0.633 -0.251
2 0.719 -0.167
3 0.561 -0.427
4 0.552 -0.125
5 0.310 0.418
6 0.247 0.446
7 0.329 0.500
8 0.410 0.269
9 0.344 -0.052
10 0.306 0.058
11 -0.033 -0.311
12 0.335 0.063
13 -0.032 0.438
14 0.220 0.338
15 0.073 0.375
16 -0.139 0.245
17 0.339 -0.806
18 0.409 -0.803
19 0.595 -1.032
20 0.430 -1.046
21 -0.544 -0.201
22 -0.397 0.003
23 -0.412 -0.046
24 -0.254 0.022
25 -0.341 -0.059
26 -0.433 0.069
27 -0.508 0.140
28 -0.513 0.142
29 -0.474 -0.627
30 -0.555 -0.633
31 -0.342 -0.333
32 -0.474 -0.433
$row.coefficients
$row.coefficients[[1]]
1 2 3 4 5
-1.561 -0.963 -2.739 -0.965 -1.000
$est
[1] "median"
$calc.ics
[1] FALSE
$trial.size
[1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[43] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[85] 0 0 0 0 0 0 0 0 0 0
$num.ord.levels
[1] 0
$prior.control
$prior.control$ssvs.index
[1] -1
attr(,"class")
[1] "summary.boral"
## model fit diagnostic plots
plot(lvm.zostera)
NULL
The residuals plots look fine (no patterns in the residuals vs fitted, so variance is homogeneous, the quantile plot shows a (more or less) normal distribution of the residuals) - the model fits the data pretty well.
Save the zostera LVM.
write_rds(lvm.zostera,
here(save.dir, "lvm_zostera.RDS"))
Examine the biplot obtained by fitting the LVM, as well as the 20 most “important” species.
lvsplot(lvm.zostera, jitter = T, biplot = TRUE, ind.spp = 20)
Only the first 20 ``most important'' latent variable coefficients included in biplot
All in all, the final result resembles the nMDS ordination very much - same stretched clusters (Poda + Otmanli, Vromos pretty much apart, Gradina +- Ropotamo). I don’t see much difference with the nMDS. The main difference seems to be the distance between the 2 years for Poda ana Otmanli - the LVM enlarges it. Have to remember to test for year effect! The run time is actually not that bad for the seagrasses. The species singled out as significant are probably somewhat different - have to check!
Redo the biplot, because this one is not very pretty. I’m not adding the species on top, first because I’m too lazy to figure out the procedure for ordering them, and second because the plot gets too busy.
## extract the LV coordinates of the stations from the model, so that the plot can be redone in ggplot
lvs.coord.zostera <- as_tibble(lvm.zostera$lv.median)
## add the stations from the original zoobenthic table (order was not modified)
(lvs.coord.zostera <- lvs.coord.zostera %>%
bind_cols(zoo.abnd.zostera %>% select(station))
)
Make the plot and save it.
(plot.lvm.zostera <- ggplot(lvs.coord.zostera) +
geom_point(aes(x = lv1, y = lv2, colour = station)) +
scale_color_brewer(palette = "Set2", name = "station",
labels = paste0("Z", as.numeric((unique(lvs.coord.zostera %>% pull(station)))))) +
labs(x = "LV1", y = "LV2")
)
Well, this is a weird one - this plot is flipped around 0 compared to the one that boral’s plotting function gives. Otherwise nothing changes - the spatial relationships between samples are preserved. I suppose it doesn’t matter much - the axes are arbitrary after all, but strange that it happens.
## save the LVM plot for the seagrass
ggsave(file = here(figures.dir, "lvm_zostera.png"),
plot.lvm.zostera,
width = 15, height = 10, units = "cm", dpi = 300)
Fit GLMs to the sites x species matrix to try and explain the observed differences in community structure by the variation of the environmental parameters.
These functions all come from package mvabund.
Import the environmental data - the one cleaned, prepared and saved in the previous notebook (classical multivariate methods). It contains long-term averages for the water column data (as long-term as available, at least) at each station, repeated for each replicate, the sediment data (2013-2014), and the seagrass data (2013-2014), again repeated to the same number of replicates. Only the variables determined to be significant by PCA are kept.
env.zostera <- read_csv(here(save.dir, "env_data_ordinations_zostera.csv"))
## convert station to factor
(env.zostera <- env.zostera %>%
mutate(station = factor(station,
levels = c("Poda", "Otmanli", "Vromos", "Gradina", "Ropotamo")))
)
Station is a factor, the rest of the variables are numeric.
Turn the zoobenthic data (minus the all-0 taxa) into a matrix - easier for the mvabund package and methods to deal with.
## there is already one subset of filtered count data (32 x 94) - use it
zoo.mvabnd.zostera <- mvabund(zoo.abnd.flt.zostera)
First, let’s see if the groups from the latent variable model (more or less equal to the clusters from the classical ordination) are valid, and which species exhibit a response.
I’m going to try something new here - 1) loose clusters from the LVM ordination, 1 = Poda-Otmanli, 2 = Vromos, 3 = Gradina-Ropotamo. 2) stations as clusters, as I did before for the seagrass data, although I don’t believe it’s valid/justified to do so… 3) another possible configuration of clusters from the LVM ordination: 1 = Z1-Z2, 2 = Z3, 3 = Z4, 4 = Z5.
## construct the vectors of the clusters by hand - first, situation 1 above
lvm.clusters.zostera.1 <- rep(1:3, times = c(16, 4, 12))
(lvm.clusters.zostera.1 <- factor(lvm.clusters.zostera.1))
## again, for case 2
lvm.clusters.zostera.2 <- rep(1:5, times = c(8, 8, 4, 8, 4))
(lvm.clusters.zostera.2 <- factor(lvm.clusters.zostera.2))
## again, for case 3
lvm.clusters.zostera.3 <- rep(1:4, times = c(16, 4, 8, 4))
(lvm.clusters.zostera.3 <- factor(lvm.clusters.zostera.3))
LVM clusters - case 1 Check the model assumptions. 1. Mean-variance assumption => determines the choice of family parameter. Can be checked by plotting residuals vs fits: if little pattern - the chosen mean-variance assumption is plausible.
Another way: direct plotting (variance ~ mean), for each species within each factor level.
plot(manyglm(zoo.mvabnd.zostera ~ lvm.clusters.zostera.1, family = "negative.binomial"))
meanvar.plot(zoo.mvabnd.zostera ~ lvm.clusters.zostera.1, table = TRUE)
It’s not perfect, but it’s not too terrible either.
Everything looks more or less fine; fit the model.
glms.lvm.zostera.1 <- manyglm(zoo.mvabnd.zostera ~ lvm.clusters.zostera.1,
family = "negative.binomial")
Explore the fit (residuals, diagnostic plots, etc.).
## residuals vs fitted values
plot(glms.lvm.zostera.1)
## all traditional (g)lm diagnostic plots
plot.manyglm(glms.lvm.zostera.1, which = 1:3)
# ### source mvabund GLM plotting functions modified to use a grey palette - I just can't redo these plots on my own, the function is doing too complicated things internally to scale the x and y axes
# source(here(functions.dir, "default.plot.manyglm_grey.R"))
# source(here(functions.dir, "plot.manyglm_grey.R"))
#
# par(mfrow = c(2,2))
# lapply(1:3, function(i) plot.manyglm.grey(glms.lvm.zostera, which = i, sub.caption = ""))
# par(mfrow = c(1, 1))
I really don’t like the rainbow palette, but I would like to include these plots in my thesis results.. Will have to do something about it, just not right now.
Save the model!
write_rds(glms.lvm.zostera.1,
here(save.dir, "glms_lvm_zostera_1.RDS"))
Let’s see the model summary (NB takes a LOT of time if there are many resamplings!).
(glms.lvm.zostera.1.summary <- summary(glms.lvm.zostera.1,
test = "LR", p.uni = "adjusted",
nBoot = 999, ## limit the number of permutations if you just want to check it out
show.time = "all")
)
The factor is highly significant according to the models.
This also allows us to see which species exhibit a response to the chosen factor. The LR (likelihood ratio) statistic is used as a measure of the strength of individual taxon contributions to the observed patterns. I’ll save the summary for safekeeping, but I’ll also run an anova - to get an analysis of deviance table on the model fit (also better for extracting the species contributions, or at least I know how to do it).
write_rds(glms.lvm.zostera.1.summary,
here(save.dir, "glms_lvm_zostera_1_summary.RDS"))
Run the anova on the model.
(glms.lvm.zostera.1.aov <- anova.manyglm(glms.lvm.zostera.1,
test = "LR", p.uni = "adjusted",
nBoot = 999, ## limit the number of permutations for a shorter run time
pairwise.comp = ~lvm.clusters.zostera.1, ## check the pairwise comparison between clusters
show.time = "all")
)
Resampling begins for test 1.
Resampling run 0 finished. Time elapsed: 0.00 minutes...
Resampling run 100 finished. Time elapsed: 0.12 minutes...
Resampling run 200 finished. Time elapsed: 0.25 minutes...
Resampling run 300 finished. Time elapsed: 0.38 minutes...
Resampling run 400 finished. Time elapsed: 0.50 minutes...
Resampling run 500 finished. Time elapsed: 0.63 minutes...
Resampling run 600 finished. Time elapsed: 0.75 minutes...
Resampling run 700 finished. Time elapsed: 0.88 minutes...
Resampling run 800 finished. Time elapsed: 1.01 minutes...
Resampling run 900 finished. Time elapsed: 1.13 minutes...
Time elapsed: 0 hr 1 min 14 sec
Analysis of Deviance Table
Model: manyglm(formula = zoo.mvabnd.zostera ~ lvm.clusters.zostera.1,
Model: family = "negative.binomial")
Multivariate test:
Res.Df Df.diff Dev Pr(>Dev)
(Intercept) 31
lvm.clusters.zostera.1 29 2 703.6 0.001 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Pairwise comparison results:
Observed statistic
lvm.clusters.zostera.1:1 vs lvm.clusters.zostera.1:3 370.0
lvm.clusters.zostera.1:2 vs lvm.clusters.zostera.1:3 346.1
lvm.clusters.zostera.1:1 vs lvm.clusters.zostera.1:2 319.4
Free Stepdown Adjusted P-Value
lvm.clusters.zostera.1:1 vs lvm.clusters.zostera.1:3 0.001 ***
lvm.clusters.zostera.1:2 vs lvm.clusters.zostera.1:3 0.001 ***
lvm.clusters.zostera.1:1 vs lvm.clusters.zostera.1:2 0.001 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Univariate Tests:
Abra.alba Abra.sp. Actiniaria
Dev Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 25.931 0.002 4.159 0.986 1.386 1.000
Alitta.succinea Ampelisca.diadema
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 8.646 0.434 20.059 0.005
Amphibalanus.improvisus Ampithoe.sp.
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 14.882 0.036 6.321 0.802
Anadara.kagoshimensis Apherusa.bispinosa
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 1.386 1.000 1.962 1.000
Apseudopsis.ostroumovi Bittium.reticulatum
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 30.855 0.001 31.183 0.001
Brachynotus.sexdentatus Capitella.capitata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 0.575 1.000 26.213 0.002
Capitella.minima Chamelea.gallina
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 0.739 1.000 26.23 0.002
Chironomidae.larvae Cumella.limicola
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 4.195 0.979 32.545 0.001
Cumella.pygmaea Cytharella.costulata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 4.228 0.979 3.122 0.996
Diogenes.pugilator Eteone.flava Eunice.vittata
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
lvm.clusters.zostera.1 0.896 1.000 4.159 0.987 0.871
Eurydice.dollfusi Exogone.naidina
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 1.000 4.228 0.979 5.944 0.839
Gastrosaccus.sanctus Genetyllis.tuberculata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 1.962 1.000 0.467 1.000
Glycera.sp. Glycera.tridactyla
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 7.992 0.559 4.484 0.961
Glycera.unicornis Harmothoe.imbricata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 1.386 1.000 1.841 1.000
Harmothoe.reticulata Heteromastus.filiformis
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 5.13 0.925 10.222 0.247
Hirudinea Hydrobia.acuta Hydrobia.sp.
Dev Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 0.915 1.000 1.438 1.000 1.681 1.000
Iphinoe.tenella Kellia.suborbicularis
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 4.16 0.981 4.584 0.949
Lagis.koreni Leiochone.leiopygos
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 9.705 0.296 6.218 0.812
Lentidium.mediterraneum Lepidochitona.cinerea
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 3.923 0.989 1.962 1.000
Loripes.orbiculatus Lucinella.divaricata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 25.259 0.002 4.257 0.979
Magelona.papillicornis Maldane.glebifex
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 1.962 1.000 1.386 1.000
Melinna.palmata Microdeutopus.gryllotalpa
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 24.203 0.003 3.088 0.996
Micromaldane.ornithochaeta Micronephthys.stammeri
Dev Pr(>Dev) Dev
(Intercept)
lvm.clusters.zostera.1 4.544 0.959 0.575
Microphthalmus.fragilis Microphthalmus.sp.
Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
lvm.clusters.zostera.1 1.000 1.437 1.000 9.396
Monocorophium.acherusicum Mytilaster.lineatus
Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
lvm.clusters.zostera.1 0.342 38.329 0.001 21.933
Mytilus.galloprovincialis Nemertea
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 0.003 1.386 1.000 3.554 0.995
Nephtys.cirrosa Nephtys.kersivalensis
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 0.575 1.000 1.386 1.000
Nereis.perivisceralis Nereis.pulsatoria
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 1.962 1.000 2.987 0.998
Nototropis.guttatus Oligochaeta
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 2.61 0.999 21.776 0.003
Paradoneis.harpagonea Parthenina.interstincta
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 1.386 1.000 1.965 1.000
Parvicardium.exiguum Perinereis.cultrifera
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 2.086 1.000 3.68 0.995
Perioculodes.longimanus Phoronida
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 2.254 0.999 4.088 0.989
Phyllodoce.sp. Platyhelminthes
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 4.159 0.987 4.534 0.959
Platynereis.dumerilii Polititapes.aureus
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 7.28 0.627 3.315 0.996
Polychaeta.larvae Polydora.ciliata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 4.159 0.984 15.69 0.022
Polygordius.neapolitanus Prionospio.cirrifera
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 4.159 0.984 13.193 0.072
Protodorvillea.kefersteini Pseudocuma.longicorne
Dev Pr(>Dev) Dev
(Intercept)
lvm.clusters.zostera.1 17.536 0.009 1.491
Rissoa.membranacea Rissoa.splendida
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 1.000 0.158 1.000 11.549 0.145
Salvatoria.clavata Schistomeringos.rudolphi
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 17.003 0.015 2.634 0.999
Sphaerosyllis.hystrix Spio.filicornis
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 12.713 0.085 28.109 0.001
Spisula.subtruncata Stenosoma.capito
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 5.885 0.842 5.011 0.930
Syllis.gracilis Syllis.hyalina Tellina.tenuis
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
lvm.clusters.zostera.1 5.956 0.839 2.048 1.000 1.491
Thracia.phaseolina Tricolia.pullus
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 1.000 1.962 1.000 7.956 0.559
Tritia.neritea Tritia.reticulata Turbellaria
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
lvm.clusters.zostera.1 1.406 1.000 2.932 0.999 0.135
Upogebia.pusilla
Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.1 1.000 4.257 0.979
Arguments:
Test statistics calculated assuming uncorrelated response (for faster computation)
P-value calculated using 999 resampling iterations via PIT-trap resampling (to account for correlation in testing.
Aaaand the differences between clusters are highly significant in this iteration..
Save the ANOVA, too.
write_rds(glms.lvm.zostera.1.aov,
here(save.dir, "glms_lvm_zostera_1_anova.RDS"))
NOW let’s get the taxa with the highest contributions to the tested pattern.
## get the top contributing species for the initial zostera GLMs
(top.sp.glms.lvm.zostera.1 <- top_n_sp_glm(glms.lvm.zostera.1.aov, tot.dev.expl = 0.75)
)
[1] "Total deviance explained: 0.76"
Monocorophium.acherusicum Cumella.limicola Bittium.reticulatum
38.328670 32.545296 31.182981
Apseudopsis.ostroumovi Spio.filicornis Chamelea.gallina
30.854772 28.108956 26.230014
Capitella.capitata Abra.alba Loripes.orbiculatus
26.212753 25.931365 25.258931
Melinna.palmata Mytilaster.lineatus Oligochaeta
24.202974 21.932810 21.776133
Ampelisca.diadema Protodorvillea.kefersteini Salvatoria.clavata
20.058951 17.536359 17.003452
Polydora.ciliata Amphibalanus.improvisus Prionospio.cirrifera
15.689516 14.882244 13.192537
Sphaerosyllis.hystrix Rissoa.splendida Heteromastus.filiformis
12.713470 11.548802 10.221754
Lagis.koreni Microphthalmus.sp. Alitta.succinea
9.704792 9.395618 8.646146
Glycera.sp. Tricolia.pullus Platynereis.dumerilii
7.992056 7.955930 7.279560
Ampithoe.sp. Leiochone.leiopygos Syllis.gracilis
6.321173 6.218039 5.956444
## unfortunately, mvabund likes to rename my species when converting the data to matrix (no spaces in names), and since I'm going to look them up in my initial untransformed count data, I have to change them back..
names(top.sp.glms.lvm.zostera.1) <- names(top.sp.glms.lvm.zostera.1) %>%
str_replace(pattern = "\\.", replacement = " ")
top.sp.glms.lvm.zostera.1
Monocorophium acherusicum Cumella limicola Bittium reticulatum
38.328670 32.545296 31.182981
Apseudopsis ostroumovi Spio filicornis Chamelea gallina
30.854772 28.108956 26.230014
Capitella capitata Abra alba Loripes orbiculatus
26.212753 25.931365 25.258931
Melinna palmata Mytilaster lineatus Oligochaeta
24.202974 21.932810 21.776133
Ampelisca diadema Protodorvillea kefersteini Salvatoria clavata
20.058951 17.536359 17.003452
Polydora ciliata Amphibalanus improvisus Prionospio cirrifera
15.689516 14.882244 13.192537
Sphaerosyllis hystrix Rissoa splendida Heteromastus filiformis
12.713470 11.548802 10.221754
Lagis koreni Microphthalmus sp. Alitta succinea
9.704792 9.395618 8.646146
Glycera sp. Tricolia pullus Platynereis dumerilii
7.992056 7.955930 7.279560
Ampithoe sp. Leiochone leiopygos Syllis gracilis
6.321173 6.218039 5.956444
Try to plot these top contributing species - for whatever that’s worth, because 50 species on a plot is still a monstrosity.
## get the species and their abundances from the original count data, and transform them to long format
(abnd.top.sp.glms.lvm.zostera.1 <- zoo.abnd.zostera %>%
select(station, names(top.sp.glms.lvm.zostera.1)) %>%
gather(key = "species", value = "count", -station) %>%
## turn species into a factor, or you'll be very very sorry later, when they're out of order on the plot. NB need to be in REVERSE order, because ggplot plots from bottom to top, and I want the top-contributing species on top.
mutate(species = factor(species, levels = rev(names(top.sp.glms.lvm.zostera.1)))) %>%
mutate(group = factor(case_when(station %in% c("Poda", "Otmanli") ~ 1,
station == "Vromos" ~ 2,
station %in% c("Gradina", "Ropotamo") ~ 3))) ## add the groups to the long df
)
(plot.top.sp.glms.lvm.zostera.1 <- plot_top_n(abnd.top.sp.glms.lvm.zostera.1,
mapping = aes(x = species, y = log_y_min(count), colour = group),
labs.legend = paste0("group", as.character(levels(abnd.top.sp.glms.lvm.zostera.1$group))),
lab.y = "Abundance (log(y/min + 1))",
palette = "Set2"
) +
theme(legend.position = "top", legend.title = element_blank())
)
Well this is a nightmarish plot, but more tolerable than the one for the sand stations - there are less species here, so at least it’s readable..
Extract the top-contributing species to each cluster (this same nightmare above, but as a table). This chunk is STILL hopelessly ugly and clumsy.
top.sp.abnd.glms.lvm.zostera.1 <- lapply(names(glms.lvm.zostera.1.summary$aliased), function(x) top_sp_glms_table(glms.lvm.zostera.1.summary, x, p = 0.05))
## fix species names (remove dot)
top.sp.abnd.glms.lvm.zostera.1 <- lapply(top.sp.abnd.glms.lvm.zostera.1, function(x) x %>% mutate(species = str_replace(species, pattern = "\\.", replacement = " ")))
## rename columns (= group names) - right now they are something like "lvm.clusters.zostera2" etc.
top.sp.abnd.glms.lvm.zostera.1 <- lapply(top.sp.abnd.glms.lvm.zostera.1, function(x) x %>% rename_at(vars(contains("lvm.clusters.zostera.1")), list(~str_replace_all(., pattern = "lvm.clusters.zostera.1", "group_"))))
top.sp.abnd.glms.lvm.zostera.1 <- lapply(top.sp.abnd.glms.lvm.zostera.1, function(x) x %>% rename_at(vars(contains("Intercept")), list(~str_replace_all(., pattern = "\\(Intercept\\)", "group_1"))))
## pull the abundances from the original count df and add to the summary glm tables
## make a long df of abundances & add clusters
zoo.abnd.zostera.long.1 <- zoo.abnd.zostera %>%
select(-c(month:replicate)) %>%
gather(key = "species", value = "count", -station) %>%
mutate(group = case_when(station %in% c("Poda", "Otmanli") ~ 1,
station == "Vromos" ~ 2,
station %in% c("Gradina", "Ropotamo") ~ 3)
)
## sum sp abundances by group; nest by group
zoo.abnd.zostera.long.1.smry <- zoo.abnd.zostera.long.1 %>%
group_by(species, group) %>%
summarise(total_count = sum(count)) %>%
group_by(group) %>%
nest()
## add the counts to the group dfs - wow that's an ugly, ugly hack. Wish I had more time to write this up properly..
top.sp.abnd.glms.lvm.zostera.1 <- map2(top.sp.abnd.glms.lvm.zostera.1, zoo.abnd.zostera.long.1.smry %>% pull(group), ~left_join(.x, zoo.abnd.zostera.long.1.smry %>% filter(group == .y) %>% unnest(), by = "species"))
## since these are sum counts over all the replicates (that's why the monstrous numbers), average them to be mean counts per group. NB different groups consist of different numbers of replicates, b.c. some groups consist of more than one station
(top.sp.abnd.glms.lvm.zostera.1 <- map2(top.sp.abnd.glms.lvm.zostera.1, c(16, 4, 12), function(x, y) x %>% mutate(mean_count = total_count/y))
)
[[1]]
[[2]]
[[3]]
NA
In this case, the model shows which species exhibit a reaction based on the chosen groups - in other words, which species are more likely to be more/less abundant in each group.
I have to say, in the case of the seagrasses and case 1 clusters, there are much fewer species that exhibit a significant response - around 10 for each group.
The LRs are lower for groups 2 and 3 - not sure if this means anything, but for group 1 they are much much higher..
For group 1 (= Z1-Z2), the species/taxa with significantly higher abundance are: Bittium reticulatum, Capitella minima, Oligochaeta, H. filiformis, Polydora ciliata, Prionospio cirrifera, R. membranacea, A. alba, A.diadema, M. acherusicum; and the only one with a significantly lower abundance - Chamelea gallina.
For group 2 (= Z3), the species with higher abundance are: M. acherusicum, S. filicornis, A.dadema. The species with lower abundance are: B. reticulatum, A. alba, Oligochaeta, S. clavata, P. ciliata, P. cirrifera, H. filiformis.
For group 3 (= Z4-Z5), the species with higher abundance are: Cumella limicola, Apseudopsis ostroumovi, Capitella capitata, Mytilaster lineatus, Loripes orbiculatus; less so, but still present - C. gallina, S. clavata. The species with lower abundance are: Abra alba, Melinna palmata (totally absent).
I’ll test each station as its own group, too (as I did before, with the classical multivariate methods) - I’m not sure how much I can trust this grouping (in particular group 3 is a bit far-fetched, if you ask me..).
LVM clusters - case 2 Check the model assumptions.
plot(manyglm(zoo.mvabnd.zostera ~ lvm.clusters.zostera.2, family = "negative.binomial"))
meanvar.plot(zoo.mvabnd.zostera ~ lvm.clusters.zostera.2, table = TRUE)
It’s not perfect, but it’s not too terrible either. I think it’s a little worse than the case 1 fit.
Everything looks more or less fine; fit the model.
glms.lvm.zostera.2 <- manyglm(zoo.mvabnd.zostera ~ lvm.clusters.zostera.2,
family = "negative.binomial")
Explore the fit (residuals, diagnostic plots, etc.).
## residuals vs fitted values
plot(glms.lvm.zostera.2)
## all traditional (g)lm diagnostic plots
plot.manyglm(glms.lvm.zostera.2, which = 1:3)
# ### source mvabund GLM plotting functions modified to use a grey palette - I just can't redo these plots on my own, the function is doing too complicated things internally to scale the x and y axes
# source(here(functions.dir, "default.plot.manyglm_grey.R"))
# source(here(functions.dir, "plot.manyglm_grey.R"))
#
# par(mfrow = c(2,2))
# lapply(2:3, function(i) plot.manyglm.grey(glms.lvm.zostera, which = i, sub.caption = ""))
# par(mfrow = c(2, 2))
Save the model!
write_rds(glms.lvm.zostera.2,
here(save.dir, "glms_lvm_zostera_2.RDS"))
Let’s see the model summary (NB takes a LOT of time if there are many resamplings!).
glms.lvm.zostera.2.summary
Test statistics:
LR value Pr(>LR)
(Intercept) 1080.0 0.001 ***
lvm.clusters.zostera.22 256.8 0.001 ***
lvm.clusters.zostera.23 310.9 0.001 ***
lvm.clusters.zostera.24 471.9 0.001 ***
lvm.clusters.zostera.25 346.6 0.001 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Univariate test statistic:
(Intercept) lvm.clusters.zostera.22
LR value Pr(>LR) LR value Pr(>LR)
Abra.alba 31.096 0.001 0.023 1.000
Abra.sp. 4.677 0.714 0.000 1.000
Actiniaria 2.341 0.978 1.386 0.990
Alitta.succinea 25.658 0.001 23.057 0.002
Ampelisca.diadema 54.649 0.001 10.416 0.072
Amphibalanus.improvisus 23.546 0.001 8.177 0.181
Ampithoe.sp. 8.217 0.202 3.482 0.823
Anadara.kagoshimensis 2.341 0.978 1.386 0.990
Apherusa.bispinosa 3.770 0.854 0.000 1.000
Apseudopsis.ostroumovi 14.963 0.013 1.380 0.992
Bittium.reticulatum 126.101 0.001 0.004 1.000
Brachynotus.sexdentatus 3.387 0.910 1.386 0.990
Capitella.capitata 5.997 0.502 2.862 0.912
Capitella.minima 132.041 0.001 0.433 1.000
Chamelea.gallina 15.617 0.009 1.386 0.990
Chironomidae.larvae 6.560 0.425 0.000 1.000
Cumella.limicola 13.674 0.027 7.694 0.208
Cumella.pygmaea 5.165 0.620 0.000 1.000
Cytharella.costulata 12.759 0.036 4.159 0.675
Diogenes.pugilator 6.380 0.439 0.680 0.999
Eteone.flava 4.677 0.714 0.000 1.000
Eunice.vittata 1.521 0.992 0.208 1.000
Eurydice.dollfusi 5.165 0.620 0.000 1.000
Exogone.naidina 5.874 0.506 1.250 0.995
Gastrosaccus.sanctus 3.770 0.854 0.000 1.000
Genetyllis.tuberculata 6.742 0.398 5.746 0.444
Glycera.sp. 2.965 0.944 0.000 1.000
Glycera.tridactyla 2.776 0.955 1.033 0.998
Glycera.unicornis 2.341 0.978 1.386 0.990
Harmothoe.imbricata 0.759 1.000 5.561 0.476
Harmothoe.reticulata 6.385 0.439 5.794 0.444
Heteromastus.filiformis 62.249 0.001 10.679 0.060
Hirudinea 4.137 0.812 0.000 1.000
Hydrobia.acuta 0.171 1.000 1.494 0.983
Hydrobia.sp. 0.116 1.000 3.709 0.788
Iphinoe.tenella 4.775 0.705 4.354 0.646
Kellia.suborbicularis 1.985 0.978 0.104 1.000
Lagis.koreni 0.095 1.000 5.999 0.421
Leiochone.leiopygos 1.899 0.978 0.336 1.000
Lentidium.mediterraneum 6.813 0.388 0.000 1.000
Lepidochitona.cinerea 3.770 0.854 0.000 1.000
Loripes.orbiculatus 1.160 0.995 3.172 0.869
Lucinella.divaricata 3.682 0.861 0.000 1.000
Magelona.papillicornis 3.770 0.854 0.000 1.000
Maldane.glebifex 2.341 0.978 1.386 0.990
Melinna.palmata 2.455 0.978 2.657 0.931
Microdeutopus.gryllotalpa 14.797 0.013 2.603 0.933
Micromaldane.ornithochaeta 6.542 0.426 0.000 1.000
Micronephthys.stammeri 3.925 0.837 1.386 0.990
Microphthalmus.fragilis 1.716 0.983 1.494 0.983
Microphthalmus.sp. 5.680 0.536 0.000 1.000
Monocorophium.acherusicum 12.799 0.036 0.213 1.000
Mytilaster.lineatus 0.385 1.000 12.953 0.032
Mytilus.galloprovincialis 2.341 0.978 1.386 0.990
Nemertea 0.000 1.000 5.479 0.494
Nephtys.cirrosa 5.423 0.582 1.386 0.990
Nephtys.kersivalensis 2.341 0.978 1.386 0.990
Nereis.perivisceralis 3.770 0.854 0.000 1.000
Nereis.pulsatoria 0.020 1.000 3.251 0.853
Nototropis.guttatus 0.402 1.000 0.116 1.000
Oligochaeta 58.093 0.001 9.386 0.110
Paradoneis.harpagonea 2.341 0.978 1.386 0.990
Parthenina.interstincta 0.017 1.000 1.662 0.983
Parvicardium.exiguum 6.468 0.429 0.063 1.000
Perinereis.cultrifera 0.177 1.000 2.035 0.967
Perioculodes.longimanus 2.180 0.978 0.000 1.000
Phoronida 2.237 0.978 0.110 1.000
Phyllodoce.sp. 4.677 0.714 0.000 1.000
Platyhelminthes 0.058 1.000 2.602 0.933
Platynereis.dumerilii 1.999 0.978 0.374 1.000
Polititapes.aureus 9.599 0.112 6.933 0.288
Polychaeta.larvae 4.677 0.714 0.000 1.000
Polydora.ciliata 91.477 0.001 12.416 0.033
Polygordius.neapolitanus 4.677 0.714 0.000 1.000
Prionospio.cirrifera 49.773 0.001 4.922 0.568
Protodorvillea.kefersteini 5.371 0.585 4.879 0.568
Pseudocuma.longicorne 4.585 0.729 1.386 0.990
Rissoa.membranacea 20.908 0.001 1.019 0.998
Rissoa.splendida 10.372 0.071 0.000 1.000
Salvatoria.clavata 14.727 0.013 0.000 1.000
Schistomeringos.rudolphi 6.673 0.412 8.799 0.141
Sphaerosyllis.hystrix 12.303 0.039 4.024 0.720
Spio.filicornis 0.320 1.000 0.246 1.000
Spisula.subtruncata 8.280 0.194 0.000 1.000
Stenosoma.capito 3.207 0.929 6.661 0.330
Syllis.gracilis 11.730 0.042 17.831 0.005
Syllis.hyalina 2.396 0.978 0.000 1.000
Tellina.tenuis 7.750 0.294 1.386 0.990
Thracia.phaseolina 3.770 0.854 0.000 1.000
Tricolia.pullus 11.452 0.047 1.380 0.992
Tritia.neritea 0.707 1.000 3.479 0.823
Tritia.reticulata 9.399 0.132 8.301 0.174
Turbellaria 0.265 1.000 1.125 0.998
Upogebia.pusilla 5.886 0.505 0.000 1.000
lvm.clusters.zostera.23 lvm.clusters.zostera.24
LR value Pr(>LR) LR value
Abra.alba 17.297 0.003 13.450
Abra.sp. 2.197 0.783 0.000
Actiniaria 0.811 0.947 1.386
Alitta.succinea 15.046 0.008 23.057
Ampelisca.diadema 12.759 0.014 3.426
Amphibalanus.improvisus 10.584 0.036 16.614
Ampithoe.sp. 9.419 0.062 4.372
Anadara.kagoshimensis 0.811 0.947 1.386
Apherusa.bispinosa 0.000 1.000 1.386
Apseudopsis.ostroumovi 0.000 0.969 26.746
Bittium.reticulatum 24.917 0.001 6.987
Brachynotus.sexdentatus 0.811 0.947 0.000
Capitella.capitata 0.773 0.950 17.684
Capitella.minima 0.333 0.969 2.753
Chamelea.gallina 0.000 1.000 19.316
Chironomidae.larvae 0.000 0.969 0.000
Cumella.limicola 0.000 1.000 31.096
Cumella.pygmaea 0.000 1.000 3.167
Cytharella.costulata 2.197 0.783 6.931
Diogenes.pugilator 1.483 0.898 0.000
Eteone.flava 2.197 0.783 0.000
Eunice.vittata 1.199 0.898 2.081
Eurydice.dollfusi 0.000 1.000 3.167
Exogone.naidina 6.160 0.228 2.262
Gastrosaccus.sanctus 0.000 1.000 1.386
Genetyllis.tuberculata 1.876 0.857 3.160
Glycera.sp. 2.428 0.738 4.124
Glycera.tridactyla 0.718 0.958 1.242
Glycera.unicornis 0.811 0.947 1.386
Harmothoe.imbricata 3.293 0.613 0.994
Harmothoe.reticulata 1.622 0.893 0.340
Heteromastus.filiformis 7.032 0.170 8.276
Hirudinea 0.811 0.947 0.000
Hydrobia.acuta 0.884 0.941 1.494
Hydrobia.sp. 2.194 0.783 1.407
Iphinoe.tenella 0.762 0.952 0.276
Kellia.suborbicularis 1.257 0.898 3.343
Lagis.koreni 4.950 0.375 0.180
Leiochone.leiopygos 3.040 0.670 4.486
Lentidium.mediterraneum 0.000 1.000 2.773
Lepidochitona.cinerea 0.000 1.000 1.386
Loripes.orbiculatus 0.068 0.969 23.773
Lucinella.divaricata 0.000 1.000 3.204
Magelona.papillicornis 0.000 1.000 1.386
Maldane.glebifex 0.811 0.947 1.386
Melinna.palmata 9.495 0.062 5.545
Microdeutopus.gryllotalpa 0.089 0.969 1.848
Micromaldane.ornithochaeta 2.067 0.809 3.568
Micronephthys.stammeri 0.811 0.947 1.386
Microphthalmus.fragilis 0.000 0.969 0.000
Microphthalmus.sp. 0.000 0.969 3.972
Monocorophium.acherusicum 20.414 0.002 4.667
Mytilaster.lineatus 2.713 0.724 35.697
Mytilus.galloprovincialis 0.811 0.947 1.386
Nemertea 0.608 0.958 4.090
Nephtys.cirrosa 0.000 1.000 1.386
Nephtys.kersivalensis 0.811 0.947 1.386
Nereis.perivisceralis 0.000 1.000 1.386
Nereis.pulsatoria 1.949 0.850 3.251
Nototropis.guttatus 2.528 0.725 1.537
Oligochaeta 11.422 0.027 9.333
Paradoneis.harpagonea 0.811 0.947 1.386
Parthenina.interstincta 2.228 0.775 0.968
Parvicardium.exiguum 1.435 0.898 0.029
Perinereis.cultrifera 2.924 0.685 0.035
Perioculodes.longimanus 1.591 0.898 0.850
Phoronida 3.210 0.631 0.396
Phyllodoce.sp. 2.197 0.783 0.000
Platyhelminthes 4.577 0.403 2.602
Platynereis.dumerilii 4.688 0.403 0.049
Polititapes.aureus 0.000 1.000 1.367
Polychaeta.larvae 2.197 0.783 0.000
Polydora.ciliata 24.008 0.001 30.614
Polygordius.neapolitanus 2.197 0.783 0.000
Prionospio.cirrifera 18.028 0.002 29.724
Protodorvillea.kefersteini 1.584 0.898 20.929
Pseudocuma.longicorne 0.811 0.947 0.000
Rissoa.membranacea 0.725 0.958 1.256
Rissoa.splendida 7.113 0.167 2.626
Salvatoria.clavata 12.384 0.017 4.104
Schistomeringos.rudolphi 0.000 1.000 6.233
Sphaerosyllis.hystrix 0.000 0.969 11.891
Spio.filicornis 19.150 0.002 0.000
Spisula.subtruncata 0.000 0.975 2.773
Stenosoma.capito 1.424 0.898 1.680
Syllis.gracilis 0.000 1.000 8.039
Syllis.hyalina 0.000 0.969 0.000
Tellina.tenuis 0.000 1.000 2.773
Thracia.phaseolina 0.000 1.000 1.386
Tricolia.pullus 0.000 0.969 2.745
Tritia.neritea 2.051 0.812 1.033
Tritia.reticulata 0.000 0.969 2.586
Turbellaria 0.285 0.969 0.158
Upogebia.pusilla 0.000 1.000 0.000
lvm.clusters.zostera.25
Pr(>LR) LR value Pr(>LR)
Abra.alba 0.018 4.346 0.669
Abra.sp. 1.000 0.000 1.000
Actiniaria 0.996 0.811 0.999
Alitta.succinea 0.002 6.818 0.295
Ampelisca.diadema 0.806 1.516 0.991
Amphibalanus.improvisus 0.005 8.450 0.159
Ampithoe.sp. 0.642 0.000 1.000
Anadara.kagoshimensis 0.996 0.811 0.999
Apherusa.bispinosa 0.995 0.000 0.999
Apseudopsis.ostroumovi 0.001 39.178 0.001
Bittium.reticulatum 0.249 0.201 0.999
Brachynotus.sexdentatus 1.000 0.811 0.999
Capitella.capitata 0.005 22.609 0.001
Capitella.minima 0.934 1.211 0.994
Chamelea.gallina 0.005 10.986 0.050
Chironomidae.larvae 1.000 5.456 0.476
Cumella.limicola 0.001 26.312 0.001
Cumella.pygmaea 0.849 0.000 1.000
Cytharella.costulata 0.256 4.394 0.664
Diogenes.pugilator 1.000 1.483 0.991
Eteone.flava 1.000 0.000 1.000
Eunice.vittata 0.983 0.210 0.999
Eurydice.dollfusi 0.849 0.000 0.999
Exogone.naidina 0.972 0.000 0.999
Gastrosaccus.sanctus 0.996 0.000 1.000
Genetyllis.tuberculata 0.850 0.000 1.000
Glycera.sp. 0.721 2.428 0.938
Glycera.tridactyla 0.997 0.718 0.999
Glycera.unicornis 0.996 0.811 0.999
Harmothoe.imbricata 0.998 3.293 0.805
Harmothoe.reticulata 1.000 2.773 0.880
Heteromastus.filiformis 0.172 1.330 0.994
Hirudinea 1.000 0.811 0.999
Hydrobia.acuta 0.993 0.884 0.999
Hydrobia.sp. 0.995 2.194 0.953
Iphinoe.tenella 1.000 0.762 0.999
Kellia.suborbicularis 0.818 1.257 0.994
Lagis.koreni 1.000 0.420 0.999
Leiochone.leiopygos 0.624 3.040 0.837
Lentidium.mediterraneum 0.921 0.000 1.000
Lepidochitona.cinerea 0.995 0.000 1.000
Loripes.orbiculatus 0.002 12.893 0.023
Lucinella.divaricata 0.844 0.000 1.000
Magelona.papillicornis 0.996 0.000 1.000
Maldane.glebifex 0.996 0.811 0.999
Melinna.palmata 0.470 3.244 0.807
Microdeutopus.gryllotalpa 0.989 6.470 0.331
Micromaldane.ornithochaeta 0.786 0.000 1.000
Micronephthys.stammeri 0.995 0.236 0.999
Microphthalmus.fragilis 1.000 0.000 1.000
Microphthalmus.sp. 0.731 7.235 0.253
Monocorophium.acherusicum 0.605 0.479 0.999
Mytilaster.lineatus 0.001 3.994 0.738
Mytilus.galloprovincialis 0.996 0.811 0.999
Nemertea 0.722 0.324 0.999
Nephtys.cirrosa 0.995 0.000 0.999
Nephtys.kersivalensis 0.996 0.811 0.999
Nereis.perivisceralis 0.996 0.000 1.000
Nereis.pulsatoria 0.831 1.949 0.972
Nototropis.guttatus 0.992 1.502 0.991
Oligochaeta 0.100 21.743 0.001
Paradoneis.harpagonea 0.996 0.811 0.999
Parthenina.interstincta 0.998 2.228 0.951
Parvicardium.exiguum 1.000 0.610 0.999
Perinereis.cultrifera 1.000 0.836 0.999
Perioculodes.longimanus 0.998 0.467 0.999
Phoronida 1.000 0.433 0.999
Phyllodoce.sp. 1.000 0.000 1.000
Platyhelminthes 0.954 4.577 0.632
Platynereis.dumerilii 1.000 0.899 0.999
Polititapes.aureus 0.996 0.000 1.000
Polychaeta.larvae 1.000 0.000 1.000
Polydora.ciliata 0.001 5.015 0.546
Polygordius.neapolitanus 1.000 0.000 1.000
Prionospio.cirrifera 0.001 0.688 0.999
Protodorvillea.kefersteini 0.004 3.630 0.780
Pseudocuma.longicorne 1.000 0.236 0.999
Rissoa.membranacea 0.997 0.171 0.999
Rissoa.splendida 0.950 11.194 0.047
Salvatoria.clavata 0.722 23.844 0.001
Schistomeringos.rudolphi 0.366 0.000 0.999
Sphaerosyllis.hystrix 0.026 9.470 0.103
Spio.filicornis 1.000 6.560 0.319
Spisula.subtruncata 0.921 2.197 0.953
Stenosoma.capito 0.989 7.067 0.269
Syllis.gracilis 0.175 21.341 0.001
Syllis.hyalina 1.000 2.507 0.929
Tellina.tenuis 0.931 0.000 1.000
Thracia.phaseolina 0.995 0.000 0.999
Tricolia.pullus 0.934 11.106 0.048
Tritia.neritea 0.998 2.051 0.963
Tritia.reticulata 0.954 2.073 0.961
Turbellaria 1.000 2.003 0.967
Upogebia.pusilla 1.000 5.769 0.409
Arguments: with 999 resampling iterations using pit.trap resampling and response assumed to be uncorrelated
Likelihood Ratio statistic: 1223, p-value: 0.001
Univariate test statistic:
Abra.alba Abra.sp. Actiniaria Alitta.succinea Ampelisca.diadema
LR value 27.461 4.159 2.773 36.585 30.570
Pr(>LR) 0.002 0.961 0.981 0.001 0.001
Amphibalanus.improvisus Ampithoe.sp. Anadara.kagoshimensis Apherusa.bispinosa
LR value 23.408 12.209 2.773 2.773
Pr(>LR) 0.008 0.282 0.981 0.981
Apseudopsis.ostroumovi Bittium.reticulatum Brachynotus.sexdentatus
LR value 52.794 34.193 2.773
Pr(>LR) 0.001 0.001 0.981
Capitella.capitata Capitella.minima Chamelea.gallina Chironomidae.larvae
LR value 33.199 7.227 28.525 9.651
Pr(>LR) 0.001 0.781 0.001 0.513
Cumella.limicola Cumella.pygmaea Cytharella.costulata Diogenes.pugilator
LR value 41.328 6.118 7.354 3.059
Pr(>LR) 0.001 0.840 0.775 0.981
Eteone.flava Eunice.vittata Eurydice.dollfusi Exogone.naidina
LR value 4.159 3.779 6.118 8.477
Pr(>LR) 0.961 0.967 0.840 0.642
Gastrosaccus.sanctus Genetyllis.tuberculata Glycera.sp. Glycera.tridactyla
LR value 2.773 7.712 7.992 5.516
Pr(>LR) 0.981 0.739 0.704 0.903
Glycera.unicornis Harmothoe.imbricata Harmothoe.reticulata
LR value 2.773 8.753 15.210
Pr(>LR) 0.981 0.597 0.093
Heteromastus.filiformis Hirudinea Hydrobia.acuta Hydrobia.sp. Iphinoe.tenella
LR value 28.142 1.726 2.932 5.959 9.824
Pr(>LR) 0.002 0.981 0.981 0.860 0.484
Kellia.suborbicularis Lagis.koreni Leiochone.leiopygos Lentidium.mediterraneum
LR value 9.077 16.471 15.331 5.545
Pr(>LR) 0.579 0.076 0.091 0.897
Lepidochitona.cinerea Loripes.orbiculatus Lucinella.divaricata
LR value 2.773 31.348 6.172
Pr(>LR) 0.981 0.001 0.830
Magelona.papillicornis Maldane.glebifex Melinna.palmata
LR value 2.773 2.773 26.860
Pr(>LR) 0.981 0.981 0.002
Microdeutopus.gryllotalpa Micromaldane.ornithochaeta Micronephthys.stammeri
LR value 16.350 6.655 4.159
Pr(>LR) 0.076 0.812 0.961
Microphthalmus.fragilis Microphthalmus.sp. Monocorophium.acherusicum
LR value 2.931 11.855 39.891
Pr(>LR) 0.981 0.306 0.001
Mytilaster.lineatus Mytilus.galloprovincialis Nemertea Nephtys.cirrosa
LR value 47.863 2.773 10.046 2.773
Pr(>LR) 0.001 0.981 0.484 0.981
Nephtys.kersivalensis Nereis.perivisceralis Nereis.pulsatoria
LR value 2.773 2.773 6.238
Pr(>LR) 0.981 0.981 0.823
Nototropis.guttatus Oligochaeta Paradoneis.harpagonea Parthenina.interstincta
LR value 7.210 36.765 2.773 4.546
Pr(>LR) 0.781 0.001 0.981 0.951
Parvicardium.exiguum Perinereis.cultrifera Perioculodes.longimanus Phoronida
LR value 2.973 6.689 4.365 5.483
Pr(>LR) 0.981 0.812 0.961 0.906
Phyllodoce.sp. Platyhelminthes Platynereis.dumerilii Polititapes.aureus
LR value 4.159 8.508 8.910 10.998
Pr(>LR) 0.961 0.642 0.597 0.372
Polychaeta.larvae Polydora.ciliata Polygordius.neapolitanus
LR value 4.159 41.905 4.159
Pr(>LR) 0.961 0.001 0.961
Prionospio.cirrifera Protodorvillea.kefersteini Pseudocuma.longicorne
LR value 46.273 30.140 3.112
Pr(>LR) 0.001 0.001 0.981
Rissoa.membranacea Rissoa.splendida Salvatoria.clavata Schistomeringos.rudolphi
LR value 2.720 17.118 32.959 13.822
Pr(>LR) 0.981 0.053 0.001 0.172
Sphaerosyllis.hystrix Spio.filicornis Spisula.subtruncata Stenosoma.capito
LR value 16.760 34.879 5.885 13.850
Pr(>LR) 0.068 0.001 0.863 0.172
Syllis.gracilis Syllis.hyalina Tellina.tenuis Thracia.phaseolina
LR value 28.543 4.555 4.499 2.773
Pr(>LR) 0.001 0.951 0.951 0.981
Tricolia.pullus Tritia.neritea Tritia.reticulata Turbellaria Upogebia.pusilla
LR value 14.668 5.516 11.233 2.652 10.026
Pr(>LR) 0.118 0.903 0.353 0.981 0.484
Arguments:
Test statistics calculated assuming response assumed to be uncorrelated
P-value calculated using 999 resampling iterations via pit.trap resampling (to account for correlation in testing).
The factor is highly significant according to the models.
Again, save the summary for safekeeping, but also run an anova.
write_rds(glms.lvm.zostera.2.summary,
here(save.dir, "glms_lvm_zostera_2_summary.RDS"))
Run the anova on the model.
(glms.lvm.zostera.2.aov <- anova.manyglm(glms.lvm.zostera.2,
test = "LR", p.uni = "adjusted",
nBoot = 999, ## limit the number of permutations for a shorter run time
pairwise.comp = ~lvm.clusters.zostera.2, ## check the pairwise comparison between clusters
show.time = "all")
)
Resampling begins for test 1.
Resampling run 0 finished. Time elapsed: 0.00 minutes...
Resampling run 100 finished. Time elapsed: 0.12 minutes...
Resampling run 200 finished. Time elapsed: 0.24 minutes...
Resampling run 300 finished. Time elapsed: 0.37 minutes...
Resampling run 400 finished. Time elapsed: 0.48 minutes...
Resampling run 500 finished. Time elapsed: 0.60 minutes...
Resampling run 600 finished. Time elapsed: 0.72 minutes...
Resampling run 700 finished. Time elapsed: 0.84 minutes...
Resampling run 800 finished. Time elapsed: 0.96 minutes...
Resampling run 900 finished. Time elapsed: 1.08 minutes...
Time elapsed: 0 hr 1 min 12 sec
Analysis of Deviance Table
Model: manyglm(formula = zoo.mvabnd.zostera ~ lvm.clusters.zostera.2,
Model: family = "negative.binomial")
Multivariate test:
Res.Df Df.diff Dev Pr(>Dev)
(Intercept) 31
lvm.clusters.zostera.2 27 4 1223 0.001 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Pairwise comparison results:
Observed statistic
lvm.clusters.zostera.2:1 vs lvm.clusters.zostera.2:4 418.6
lvm.clusters.zostera.2:3 vs lvm.clusters.zostera.2:4 368.1
lvm.clusters.zostera.2:3 vs lvm.clusters.zostera.2:5 336.6
lvm.clusters.zostera.2:2 vs lvm.clusters.zostera.2:3 325.3
lvm.clusters.zostera.2:1 vs lvm.clusters.zostera.2:5 310.4
lvm.clusters.zostera.2:4 vs lvm.clusters.zostera.2:5 295.1
lvm.clusters.zostera.2:2 vs lvm.clusters.zostera.2:4 278.8
lvm.clusters.zostera.2:1 vs lvm.clusters.zostera.2:3 278.8
lvm.clusters.zostera.2:2 vs lvm.clusters.zostera.2:5 271.7
lvm.clusters.zostera.2:1 vs lvm.clusters.zostera.2:2 219.8
Free Stepdown Adjusted P-Value
lvm.clusters.zostera.2:1 vs lvm.clusters.zostera.2:4 0.002 **
lvm.clusters.zostera.2:3 vs lvm.clusters.zostera.2:4 0.008 **
lvm.clusters.zostera.2:3 vs lvm.clusters.zostera.2:5 0.009 **
lvm.clusters.zostera.2:2 vs lvm.clusters.zostera.2:3 0.009 **
lvm.clusters.zostera.2:1 vs lvm.clusters.zostera.2:5 0.009 **
lvm.clusters.zostera.2:4 vs lvm.clusters.zostera.2:5 0.009 **
lvm.clusters.zostera.2:2 vs lvm.clusters.zostera.2:4 0.009 **
lvm.clusters.zostera.2:1 vs lvm.clusters.zostera.2:3 0.009 **
lvm.clusters.zostera.2:2 vs lvm.clusters.zostera.2:5 0.009 **
lvm.clusters.zostera.2:1 vs lvm.clusters.zostera.2:2 0.009 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Univariate Tests:
Abra.alba Abra.sp. Actiniaria
Dev Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 27.461 0.002 4.159 1.000 2.773 1.000
Alitta.succinea Ampelisca.diadema
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 36.585 0.001 30.57 0.001
Amphibalanus.improvisus Ampithoe.sp.
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 23.408 0.009 12.209 0.448
Anadara.kagoshimensis Apherusa.bispinosa
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 2.773 1.000 2.773 1.000
Apseudopsis.ostroumovi Bittium.reticulatum
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 52.794 0.001 34.193 0.001
Brachynotus.sexdentatus Capitella.capitata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 2.773 1.000 33.199 0.001
Capitella.minima Chamelea.gallina
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 7.227 0.941 28.525 0.001
Chironomidae.larvae Cumella.limicola
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 9.651 0.761 41.328 0.001
Cumella.pygmaea Cytharella.costulata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 6.118 0.976 7.354 0.936
Diogenes.pugilator Eteone.flava Eunice.vittata
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
lvm.clusters.zostera.2 3.059 1.000 4.159 1.000 3.779
Eurydice.dollfusi Exogone.naidina
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 1.000 6.118 0.976 8.477 0.879
Gastrosaccus.sanctus Genetyllis.tuberculata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 2.773 1.000 7.712 0.926
Glycera.sp. Glycera.tridactyla
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 7.992 0.918 5.516 0.994
Glycera.unicornis Harmothoe.imbricata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 2.773 1.000 8.753 0.861
Harmothoe.reticulata Heteromastus.filiformis
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 15.21 0.180 28.142 0.001
Hirudinea Hydrobia.acuta Hydrobia.sp.
Dev Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 1.726 1.000 2.932 1.000 5.959 0.980
Iphinoe.tenella Kellia.suborbicularis
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 9.824 0.747 9.077 0.846
Lagis.koreni Leiochone.leiopygos
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 16.471 0.131 15.331 0.179
Lentidium.mediterraneum Lepidochitona.cinerea
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 5.545 0.990 2.773 1.000
Loripes.orbiculatus Lucinella.divaricata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 31.348 0.001 6.172 0.974
Magelona.papillicornis Maldane.glebifex
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 2.773 1.000 2.773 1.000
Melinna.palmata Microdeutopus.gryllotalpa
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 26.86 0.002 16.35 0.131
Micromaldane.ornithochaeta Micronephthys.stammeri
Dev Pr(>Dev) Dev
(Intercept)
lvm.clusters.zostera.2 6.655 0.962 4.159
Microphthalmus.fragilis Microphthalmus.sp.
Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
lvm.clusters.zostera.2 0.999 2.931 1.000 11.855
Monocorophium.acherusicum Mytilaster.lineatus
Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
lvm.clusters.zostera.2 0.487 39.891 0.001 47.863
Mytilus.galloprovincialis Nemertea
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 0.001 2.773 1.000 10.046 0.723
Nephtys.cirrosa Nephtys.kersivalensis
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 2.773 1.000 2.773 1.000
Nereis.perivisceralis Nereis.pulsatoria
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 2.773 1.000 6.238 0.971
Nototropis.guttatus Oligochaeta
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 7.21 0.941 36.765 0.001
Paradoneis.harpagonea Parthenina.interstincta
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 2.773 1.000 4.546 0.997
Parvicardium.exiguum Perinereis.cultrifera
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 2.973 1.000 6.689 0.962
Perioculodes.longimanus Phoronida
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 4.365 0.999 5.483 0.994
Phyllodoce.sp. Platyhelminthes
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 4.159 1.000 8.508 0.879
Platynereis.dumerilii Polititapes.aureus
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 8.91 0.851 10.998 0.575
Polychaeta.larvae Polydora.ciliata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 4.159 0.999 41.905 0.001
Polygordius.neapolitanus Prionospio.cirrifera
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.2 4.159 0.999 46.273 0.001
Protodorvillea.kefersteini Pseudocuma.longicorne
Dev Pr(>Dev) Dev
(Intercept) <NA> <NA> <NA>
lvm.clusters.zostera.2 30.14 0.001 3.112
Rissoa.membranacea Rissoa.splendida
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA> <NA>
lvm.clusters.zostera.2 1.000 2.72 1.000 17.118 0.113
Salvatoria.clavata Schistomeringos.rudolphi
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA>
lvm.clusters.zostera.2 32.959 0.001 13.822 0.291
Sphaerosyllis.hystrix Spio.filicornis
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA>
lvm.clusters.zostera.2 16.76 0.124 34.879 0.001
Spisula.subtruncata Stenosoma.capito
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA>
lvm.clusters.zostera.2 5.885 0.980 13.85 0.291
Syllis.gracilis Syllis.hyalina Tellina.tenuis
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept) <NA> <NA> <NA> <NA> <NA>
lvm.clusters.zostera.2 28.543 0.001 4.555 0.997 4.499
Thracia.phaseolina Tricolia.pullus
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA> <NA>
lvm.clusters.zostera.2 0.997 2.773 1.000 14.668 0.223
Tritia.neritea Tritia.reticulata Turbellaria
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept) <NA> <NA> <NA> <NA> <NA>
lvm.clusters.zostera.2 5.516 0.994 11.233 0.558 2.652
Upogebia.pusilla
Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA>
lvm.clusters.zostera.2 1.000 10.026 0.723
Arguments:
Test statistics calculated assuming uncorrelated response (for faster computation)
P-value calculated using 999 resampling iterations via PIT-trap resampling (to account for correlation in testing.
Again, these groups are sufficiently different from one another.. No clue here.
Save the ANOVA, too.
write_rds(glms.lvm.zostera.2.aov,
here(save.dir, "glms_lvm_zostera_2_anova.RDS"))
NOW let’s get the taxa with the highest contributions to the tested pattern.
## get the top contributing species for the initial zostera GLMs
(top.sp.glms.lvm.zostera.2 <- top_n_sp_glm(glms.lvm.zostera.2.aov, tot.dev.expl = 0.75)
)
[1] "Total deviance explained: 0.799"
Apseudopsis.ostroumovi Mytilaster.lineatus Prionospio.cirrifera
52.793744 47.863335 46.272692
Polydora.ciliata Cumella.limicola Monocorophium.acherusicum
41.905219 41.327723 39.891356
Oligochaeta Alitta.succinea Spio.filicornis
36.764590 36.584687 34.878811
Bittium.reticulatum Capitella.capitata Salvatoria.clavata
34.192799 33.198554 32.958829
Loripes.orbiculatus Ampelisca.diadema Protodorvillea.kefersteini
31.347733 30.569510 30.139960
Syllis.gracilis Chamelea.gallina Heteromastus.filiformis
28.542915 28.524575 28.142266
Abra.alba Melinna.palmata Amphibalanus.improvisus
27.461185 26.859546 23.408099
Rissoa.splendida Sphaerosyllis.hystrix Lagis.koreni
17.117581 16.760313 16.471224
Microdeutopus.gryllotalpa Leiochone.leiopygos Harmothoe.reticulata
16.349670 15.331303 15.209809
Tricolia.pullus Stenosoma.capito Schistomeringos.rudolphi
14.667741 13.849706 13.822279
Ampithoe.sp. Microphthalmus.sp. Tritia.reticulata
12.208710 11.854688 11.232600
Polititapes.aureus Nemertea Upogebia.pusilla
10.998455 10.045834 10.025894
Iphinoe.tenella Chironomidae.larvae Kellia.suborbicularis
9.824385 9.650905 9.077281
Platynereis.dumerilii
8.910425
## unfortunately, mvabund likes to rename my species when converting the data to matrix (no spaces in names), and since I'm going to look them up in my initial untransformed count data, I have to change them back..
names(top.sp.glms.lvm.zostera.2) <- names(top.sp.glms.lvm.zostera.2) %>%
str_replace(pattern = "\\.", replacement = " ")
top.sp.glms.lvm.zostera.2
Apseudopsis ostroumovi Mytilaster lineatus Prionospio cirrifera
52.793744 47.863335 46.272692
Polydora ciliata Cumella limicola Monocorophium acherusicum
41.905219 41.327723 39.891356
Oligochaeta Alitta succinea Spio filicornis
36.764590 36.584687 34.878811
Bittium reticulatum Capitella capitata Salvatoria clavata
34.192799 33.198554 32.958829
Loripes orbiculatus Ampelisca diadema Protodorvillea kefersteini
31.347733 30.569510 30.139960
Syllis gracilis Chamelea gallina Heteromastus filiformis
28.542915 28.524575 28.142266
Abra alba Melinna palmata Amphibalanus improvisus
27.461185 26.859546 23.408099
Rissoa splendida Sphaerosyllis hystrix Lagis koreni
17.117581 16.760313 16.471224
Microdeutopus gryllotalpa Leiochone leiopygos Harmothoe reticulata
16.349670 15.331303 15.209809
Tricolia pullus Stenosoma capito Schistomeringos rudolphi
14.667741 13.849706 13.822279
Ampithoe sp. Microphthalmus sp. Tritia reticulata
12.208710 11.854688 11.232600
Polititapes aureus Nemertea Upogebia pusilla
10.998455 10.045834 10.025894
Iphinoe tenella Chironomidae larvae Kellia suborbicularis
9.824385 9.650905 9.077281
Platynereis dumerilii
8.910425
Try to plot these top contributing species - for whatever that’s worth, because 50 species on a plot is still a monstrosity.
## get the species and their abundances from the original count data, and transform them to long format
(abnd.top.sp.glms.lvm.zostera.2 <- zoo.abnd.zostera %>%
select(station, names(top.sp.glms.lvm.zostera.2)) %>%
gather(key = "species", value = "count", -station) %>%
## turn species into a factor, or you'll be very very sorry later, when they're out of order on the plot. NB need to be in REVERSE order, because ggplot plots from bottom to top, and I want the top-contributing species on top.
mutate(species = factor(species, levels = rev(names(top.sp.glms.lvm.zostera.2)))) %>%
mutate(group = factor(case_when(station == "Poda" ~ 1,
station == "Otmanli" ~ 2,
station == "Vromos" ~ 3,
station == "Gradina" ~ 4,
station == "Ropotamo" ~ 5)))
)
(plot.top.sp.glms.lvm.zostera.2 <- plot_top_n(abnd.top.sp.glms.lvm.zostera.2,
mapping = aes(x = species, y = log_y_min(count), colour = group),
labs.legend = paste0("group", as.character(levels(abnd.top.sp.glms.lvm.zostera.2$group))),
lab.y = "Abundance (log(y/min + 1))",
palette = "Set2"
) +
theme(legend.position = "top", legend.title = element_blank())
)
Extract the top-contributing species to each cluster (this same nightmare above, but as a table). This chunk is STILL hopelessly ugly and clumsy.
top.sp.abnd.glms.lvm.zostera.2
[[1]]
[[2]]
[[3]]
[[4]]
[[5]]
NA
In the case of the seagrasses and case 2 clusters (= stations), the picture is still more unclear.. I suppose this is in no small part because of the differences 2013-14 - very marked for Poda and Otmanli. I suspect the stations changed in these two years (we were looking for Z. noltii in 2014 in particular) - but still, there is much variability. In the future, it’s probably going to be worth it to have more stations in a meadow, if we really want to have an idea of the communities there, and their variability.
The LRs seem to be a bit lower for groups 2, 4, maybe 5 too - still not sure if you can use that as a significance measure.
For now, in group 1 (= Z1), it’s hard to pick some characteristic species - because of the variability between 2013-2014, no doubt. The species/taxa with significantly higher abundance are: Bittium reticulatum, Capitella minima, Polydora ciliata, Prionosprio cirrifera (+ others, medium abundance); and the ones with a significantly lower abundance - or even absent - C. gallina, A. ostroumovi, S. clavata, C. limicola, C. costulata, S. hystrix, S. gracilis, T. pullus.
For group 2 (= Z2), the species with higher abundance - which is not really all that high; this group is also loose, hard to distinguish from group 1 - are: S. gracilis, M. lineatus, P. ciliata. The only species with lower abundance - in fact 0 - is Alitta succinea.
For group 3 (= Z3), the species with higher abundance are: M. acherusicum, S. filicornis, A. diadema. The species with lower abundance (or 0) are: B. reticulatum, P. ciliata, P. cirrifera, A. alba, A. succinea, S. clavata, Oligochaeta, A. improvisus.
For group 4 (= Z4), the species with higher abundance are: M. lineatus (very much so); C. limicola, P. kefersteini, C. gallina, C. capitata. The species with lower abundance (or 0) are: P. ciliata, P. cirrifera, A. succinea, A. improvisus, A. alba.
For group 5 (= Z5), the species with higher abundance are: A. ostroumovi, C. capitata, Oligochaeta. The species with lower abundance (or 0) are: R. splendida, T. pullus.
LVM clusters - case 3 Last try: group 1 = Z1-Z2, group 2 = Z3, group 3 = Z4, group 4 = Z5.
Check the model assumptions.
plot(manyglm(zoo.mvabnd.zostera ~ lvm.clusters.zostera.3, family = "negative.binomial"))
meanvar.plot(zoo.mvabnd.zostera ~ lvm.clusters.zostera.3, table = TRUE)
START SECTION 2
Plotting if overlay is TRUE
using grouping variable lvm.clusters.zostera.3 160 mean values were 0 and could
not be included in the log-plot
using grouping variable lvm.clusters.zostera.3 160 variance values were 0 and could not
be included in the log-plot
FINISHED SECTION 2
$mean
Bittium.reticulatum Capitella.minima Oligochaeta Ampelisca.diadema Mytilaster.lineatus
1 57.6875 50.8125 30.0625 6.25 3.250
2 0.0000 88.0000 0.7500 80.50 2.250
3 238.3750 23.1250 48.6250 24.50 76.375
4 74.2500 124.0000 201.2500 20.25 2.750
Heteromastus.filiformis Prionospio.cirrifera Polydora.ciliata
1 17.8125 25.375 26.5625
2 2.2500 0.000 0.0000
3 23.0000 0.000 0.2500
4 5.2500 20.000 11.2500
Monocorophium.acherusicum Rissoa.membranacea Capitella.capitata Apseudopsis.ostroumovi
1 3.9375 7.4375 0.4375 0.0625
2 78.2500 9.5000 0.0000 0.0000
3 1.0000 10.1250 9.8750 3.8750
4 2.2500 4.0000 39.7500 48.2500
Spio.filicornis Microdeutopus.gryllotalpa Abra.alba Cumella.limicola
1 1.4375 2.625 6.3125 0.375
2 38.2500 4.250 0.0000 0.000
3 1.2500 1.875 0.7500 10.250
4 0.0000 14.000 1.7500 6.500
Loripes.orbiculatus Parvicardium.exiguum Protodorvillea.kefersteini
1 1.125 2.8125 0.750
2 0.500 5.5000 0.000
3 8.750 2.8750 9.875
4 4.500 1.5000 1.250
Platynereis.dumerilii Nemertea Syllis.gracilis Alitta.succinea Amphibalanus.improvisus
1 1.5625 2.375 1.625 3.5625 3.3125
2 9.2500 0.500 0.000 0.0000 0.2500
3 1.6250 3.125 0.875 0.0000 0.2500
4 3.7500 1.500 7.250 1.0000 0.5000
Stenosoma.capito Lagis.koreni Schistomeringos.rudolphi Salvatoria.clavata
1 1.500 2.125 1.6875 0.000
2 0.000 0.000 0.0000 1.500
3 0.875 1.125 1.2500 0.375
4 3.750 0.500 0.0000 6.250
Leiochone.leiopygos Melinna.palmata Microphthalmus.sp. Kellia.suborbicularis
1 0.625 0.875 0.000 0.3125
2 0.000 2.750 0.000 0.0000
3 1.875 0.000 0.625 2.3750
4 0.000 0.000 5.000 0.0000
Nototropis.guttatus Chamelea.gallina Perinereis.cultrifera Sphaerosyllis.hystrix
1 0.750 0.0625 0.4375 0.1875
2 0.000 0.0000 0.0000 0.0000
3 0.125 2.0000 0.6250 1.3750
4 2.500 1.2500 2.0000 1.2500
Ampithoe.sp. Harmothoe.reticulata Phoronida Perioculodes.longimanus Rissoa.splendida
1 0.1875 0.750 0.5625 0.375 0.00
2 2.7500 0.000 0.0000 1.250 1.00
3 0.5000 0.125 0.7500 0.125 0.25
4 0.0000 1.000 0.2500 0.750 2.25
Diogenes.pugilator Iphinoe.tenella Platyhelminthes Exogone.naidina
1 0.375 0.6875 0.6875 0.0625
2 0.750 0.0000 0.0000 2.2500
3 0.250 0.2500 0.2500 0.2500
4 0.750 0.0000 0.0000 0.0000
Genetyllis.tuberculata Parthenina.interstincta Tritia.reticulata Cytharella.costulata
1 0.500 0.625 0.5625 0.1875
2 0.250 0.000 0.0000 0.2500
3 0.375 0.250 0.2500 0.6250
4 0.000 0.000 0.2500 0.5000
Syllis.hyalina Tricolia.pullus Turbellaria Harmothoe.imbricata Hydrobia.sp.
1 0.0 0.0625 0.375 0.3125 0.375
2 0.0 0.0000 0.250 0.0000 0.000
3 0.0 0.2500 0.375 0.2500 0.125
4 2.5 1.7500 0.000 0.0000 0.000
Lucinella.divaricata Nereis.pulsatoria Polititapes.aureus Upogebia.pusilla Glycera.sp.
1 0.000 0.4375 0.375 0.00 0.375
2 0.000 0.0000 0.000 0.00 0.000
3 0.875 0.0000 0.125 0.00 0.000
4 0.000 0.0000 0.000 1.75 0.000
Microphthalmus.fragilis Eunice.vittata Glycera.tridactyla Tritia.neritea
1 0.375 0.1875 0.3125 0.250
2 0.000 0.0000 0.0000 0.000
3 0.000 0.0000 0.0000 0.125
4 0.000 0.5000 0.0000 0.000
Chironomidae.larvae Hydrobia.acuta Micromaldane.ornithochaeta Cumella.pygmaea
1 0 0.25 0.000 0.000
2 0 0.00 0.250 0.000
3 0 0.00 0.375 0.375
4 1 0.00 0.000 0.000
Eurydice.dollfusi Hirudinea Pseudocuma.longicorne Spisula.subtruncata Tellina.tenuis
1 0.000 0.125 0.0625 0.00 0.0625
2 0.000 0.000 0.0000 0.00 0.0000
3 0.375 0.125 0.1250 0.25 0.2500
4 0.000 0.000 0.2500 0.25 0.0000
Brachynotus.sexdentatus Lentidium.mediterraneum Micronephthys.stammeri Nephtys.cirrosa
1 0.0625 0.00 0.0625 0.0625
2 0.0000 0.00 0.0000 0.0000
3 0.1250 0.25 0.0000 0.1250
4 0.0000 0.00 0.2500 0.0000
Abra.sp. Actiniaria Anadara.kagoshimensis Apherusa.bispinosa Eteone.flava
1 0.00 0.0625 0.0625 0.000 0.00
2 0.25 0.0000 0.0000 0.000 0.25
3 0.00 0.0000 0.0000 0.125 0.00
4 0.00 0.0000 0.0000 0.000 0.00
Gastrosaccus.sanctus Glycera.unicornis Lepidochitona.cinerea Magelona.papillicornis
1 0.000 0.0625 0.000 0.000
2 0.000 0.0000 0.000 0.000
3 0.125 0.0000 0.125 0.125
4 0.000 0.0000 0.000 0.000
Maldane.glebifex Mytilus.galloprovincialis Nephtys.kersivalensis Nereis.perivisceralis
1 0.0625 0.0625 0.0625 0.000
2 0.0000 0.0000 0.0000 0.000
3 0.0000 0.0000 0.0000 0.125
4 0.0000 0.0000 0.0000 0.000
Paradoneis.harpagonea Phyllodoce.sp. Polychaeta.larvae Polygordius.neapolitanus
1 0.0625 0.00 0.00 0.00
2 0.0000 0.25 0.25 0.25
3 0.0000 0.00 0.00 0.00
4 0.0000 0.00 0.00 0.00
Thracia.phaseolina
1 0.000
2 0.000
3 0.125
4 0.000
$var
Bittium.reticulatum Capitella.minima Oligochaeta Ampelisca.diadema Mytilaster.lineatus
1 2642.229 2899.2292 700.8625 45.53333 35.000000
2 0.000 3094.0000 2.2500 395.00000 1.583333
3 25180.554 452.6964 3778.2679 735.14286 877.125000
4 3278.250 3103.3333 18570.9167 92.91667 2.916667
Heteromastus.filiformis Prionospio.cirrifera Polydora.ciliata
1 177.495833 919.5833 1000.2625000
2 1.583333 0.0000 0.0000000
3 136.000000 0.0000 0.2142857
4 32.916667 183.3333 34.2500000
Monocorophium.acherusicum Rissoa.membranacea Capitella.capitata Apseudopsis.ostroumovi
1 17.929167 271.729167 1.595833 0.062500
2 3980.916667 11.666667 0.000000 0.000000
3 1.428571 95.553571 82.982143 9.839286
4 4.250000 6.666667 566.250000 196.250000
Spio.filicornis Microdeutopus.gryllotalpa Abra.alba Cumella.limicola
1 2.529167 10.783333 24.362500 1.183333
2 306.250000 16.250000 0.000000 0.000000
3 3.357143 2.696429 1.071429 30.500000
4 0.000000 40.666667 1.583333 23.000000
Loripes.orbiculatus Parvicardium.exiguum Protodorvillea.kefersteini
1 2.383333 18.829167 2.60000
2 1.000000 3.666667 0.00000
3 16.500000 8.410714 16.69643
4 7.000000 1.666667 2.25000
Platynereis.dumerilii Nemertea Syllis.gracilis Alitta.succinea
1 6.929167 12.2500000 7.450000 30.1291667
2 32.916667 0.3333333 0.000000 0.0000000
3 2.553571 3.8392857 2.982143 0.0000000
4 10.916667 3.6666667 22.916667 0.6666667
Amphibalanus.improvisus Stenosoma.capito Lagis.koreni Schistomeringos.rudolphi
1 23.4291667 19.7333333 6.5166667 11.295833
2 0.2500000 0.0000000 0.0000000 0.000000
3 0.2142857 0.9821429 0.9821429 3.642857
4 1.0000000 12.9166667 0.3333333 0.000000
Salvatoria.clavata Leiochone.leiopygos Melinna.palmata Microphthalmus.sp.
1 0.0000000 0.650000 1.183333 0.000
2 0.3333333 0.000000 0.250000 0.000
3 1.1250000 3.839286 0.000000 3.125
4 14.9166667 0.000000 0.000000 22.000
Kellia.suborbicularis Nototropis.guttatus Chamelea.gallina Perinereis.cultrifera
1 0.6291667 1.666667 0.062500 2.2625000
2 0.0000000 0.000000 0.000000 0.0000000
3 13.6964286 0.125000 1.714286 0.8392857
4 0.0000000 14.333333 1.583333 3.3333333
Sphaerosyllis.hystrix Ampithoe.sp. Harmothoe.reticulata Phoronida
1 0.2958333 0.2958333 0.7333333 0.5291667
2 0.0000000 11.5833333 0.0000000 0.0000000
3 2.2678571 0.5714286 0.1250000 1.0714286
4 0.9166667 0.0000000 2.0000000 0.2500000
Perioculodes.longimanus Rissoa.splendida Diogenes.pugilator Iphinoe.tenella
1 0.5166667 0.0000000 0.3833333 2.229167
2 3.5833333 2.0000000 0.2500000 0.000000
3 0.1250000 0.2142857 0.2142857 0.500000
4 0.9166667 6.9166667 0.9166667 0.000000
Platyhelminthes Exogone.naidina Genetyllis.tuberculata Parthenina.interstincta
1 1.4291667 0.0625 2.2666667 2.65
2 0.0000000 8.2500 0.2500000 0.00
3 0.2142857 0.5000 0.5535714 0.50
4 0.0000000 0.0000 0.0000000 0.00
Tritia.reticulata Cytharella.costulata Syllis.hyalina Tricolia.pullus Turbellaria
1 1.4625000 0.1625000 0 0.0625000 1.050
2 0.0000000 0.2500000 0 0.0000000 0.250
3 0.2142857 0.8392857 0 0.2142857 1.125
4 0.2500000 0.3333333 25 2.9166667 0.000
Harmothoe.imbricata Hydrobia.sp. Lucinella.divaricata Nereis.pulsatoria
1 0.6291667 1.183333 0.000000 1.4625
2 0.0000000 0.000000 0.000000 0.0000
3 0.2142857 0.125000 3.267857 0.0000
4 0.0000000 0.000000 0.000000 0.0000
Polititapes.aureus Upogebia.pusilla Glycera.sp. Microphthalmus.fragilis Eunice.vittata
1 0.650 0.000000 0.3833333 2.25 0.2958333
2 0.000 0.000000 0.0000000 0.00 0.0000000
3 0.125 0.000000 0.0000000 0.00 0.0000000
4 0.000 5.583333 0.0000000 0.00 1.0000000
Glycera.tridactyla Tritia.neritea Chironomidae.larvae Hydrobia.acuta
1 0.6291667 0.600 0 1
2 0.0000000 0.000 0 0
3 0.0000000 0.125 0 0
4 0.0000000 0.000 2 0
Micromaldane.ornithochaeta Cumella.pygmaea Eurydice.dollfusi Hirudinea
1 0.0000000 0.0000000 0.0000000 0.1166667
2 0.2500000 0.0000000 0.0000000 0.0000000
3 0.5535714 0.5535714 0.5535714 0.1250000
4 0.0000000 0.0000000 0.0000000 0.0000000
Pseudocuma.longicorne Spisula.subtruncata Tellina.tenuis Brachynotus.sexdentatus
1 0.0625 0.0000000 0.0625000 0.0625
2 0.0000 0.0000000 0.0000000 0.0000
3 0.1250 0.2142857 0.2142857 0.1250
4 0.2500 0.2500000 0.0000000 0.0000
Lentidium.mediterraneum Micronephthys.stammeri Nephtys.cirrosa Abra.sp. Actiniaria
1 0.0000000 0.0625 0.0625 0.00 0.0625
2 0.0000000 0.0000 0.0000 0.25 0.0000
3 0.2142857 0.0000 0.1250 0.00 0.0000
4 0.0000000 0.2500 0.0000 0.00 0.0000
Anadara.kagoshimensis Apherusa.bispinosa Eteone.flava Gastrosaccus.sanctus
1 0.0625 0.000 0.00 0.000
2 0.0000 0.000 0.25 0.000
3 0.0000 0.125 0.00 0.125
4 0.0000 0.000 0.00 0.000
Glycera.unicornis Lepidochitona.cinerea Magelona.papillicornis Maldane.glebifex
1 0.0625 0.000 0.000 0.0625
2 0.0000 0.000 0.000 0.0000
3 0.0000 0.125 0.125 0.0000
4 0.0000 0.000 0.000 0.0000
Mytilus.galloprovincialis Nephtys.kersivalensis Nereis.perivisceralis
1 0.0625 0.0625 0.000
2 0.0000 0.0000 0.000
3 0.0000 0.0000 0.125
4 0.0000 0.0000 0.000
Paradoneis.harpagonea Phyllodoce.sp. Polychaeta.larvae Polygordius.neapolitanus
1 0.0625 0.00 0.00 0.00
2 0.0000 0.25 0.25 0.25
3 0.0000 0.00 0.00 0.00
4 0.0000 0.00 0.00 0.00
Thracia.phaseolina
1 0.000
2 0.000
3 0.125
4 0.000
More or less the same as case 2 before it.
Everything looks more or less fine; fit the model.
glms.lvm.zostera.3 <- manyglm(zoo.mvabnd.zostera ~ lvm.clusters.zostera.3,
family = "negative.binomial")
Explore the fit (residuals, diagnostic plots, etc.).
## residuals vs fitted values
plot(glms.lvm.zostera.3)
## all traditional (g)lm diagnostic plots
plot.manyglm(glms.lvm.zostera.3, which = 1:3)
# ### source mvabund GLM plotting functions modified to use a grey palette - I just can't redo these plots on my own, the function is doing too complicated things internally to scale the x and y axes
# source(here(functions.dir, "default.plot.manyglm_grey.R"))
# source(here(functions.dir, "plot.manyglm_grey.R"))
#
# par(mfrow = c(3,3))
# lapply(3:3, function(i) plot.manyglm.grey(glms.lvm.zostera, which = i, sub.caption = ""))
# par(mfrow = c(3, 3))
Save the model!
write_rds(glms.lvm.zostera.3,
here(save.dir, "glms_lvm_zostera_3.RDS"))
Let’s see the model summary (NB takes a LOT of time if there are many resamplings!).
glms.lvm.zostera.3.summary
Test statistics:
LR value Pr(>LR)
(Intercept) 1394.5 0.001 ***
lvm.clusters.zostera.32 358.1 0.001 ***
lvm.clusters.zostera.33 423.5 0.001 ***
lvm.clusters.zostera.34 335.3 0.001 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Univariate test statistic:
(Intercept) lvm.clusters.zostera.32
LR value Pr(>LR) LR value Pr(>LR)
Abra.alba 47.727 0.001 18.148 0.004
Abra.sp. 6.107 0.547 3.219 0.632
Actiniaria 2.833 0.939 0.446 0.990
Alitta.succinea 8.284 0.276 5.558 0.259
Ampelisca.diadema 45.273 0.001 20.069 0.002
Amphibalanus.improvisus 15.404 0.025 5.997 0.240
Ampithoe.sp. 5.782 0.605 6.490 0.224
Anadara.kagoshimensis 2.833 0.939 0.446 0.990
Apherusa.bispinosa 5.024 0.728 0.000 1.000
Apseudopsis.ostroumovi 21.836 0.019 0.445 0.990
Bittium.reticulatum 159.822 0.001 25.436 0.002
Brachynotus.sexdentatus 4.881 0.753 0.446 0.990
Capitella.capitata 3.390 0.925 2.606 0.762
Capitella.minima 158.885 0.001 0.860 0.984
Chamelea.gallina 21.471 0.019 0.446 0.990
Chironomidae.larvae 9.401 0.220 0.000 0.996
Cumella.limicola 6.366 0.532 2.538 0.774
Cumella.pygmaea 7.559 0.402 0.000 1.000
Cytharella.costulata 10.276 0.177 0.059 0.996
Diogenes.pugilator 7.671 0.396 0.877 0.984
Eteone.flava 6.107 0.547 3.219 0.632
Eunice.vittata 3.020 0.926 1.027 0.968
Eurydice.dollfusi 7.559 0.402 0.000 1.000
Exogone.naidina 6.206 0.534 5.880 0.240
Gastrosaccus.sanctus 5.024 0.728 0.000 1.000
Genetyllis.tuberculata 0.996 0.986 0.185 0.996
Glycera.sp. 4.780 0.753 2.664 0.745
Glycera.tridactyla 2.091 0.973 1.471 0.930
Glycera.unicornis 2.833 0.939 0.446 0.990
Harmothoe.imbricata 3.139 0.926 1.743 0.883
Harmothoe.reticulata 0.997 0.986 5.096 0.313
Heteromastus.filiformis 123.751 0.001 11.936 0.030
Hirudinea 5.835 0.594 0.893 0.984
Hydrobia.acuta 0.471 0.986 0.467 0.989
Hydrobia.sp. 0.941 0.986 1.166 0.950
Iphinoe.tenella 0.542 0.986 2.867 0.704
Kellia.suborbicularis 2.897 0.939 1.598 0.914
Lagis.koreni 6.615 0.510 8.571 0.108
Leiochone.leiopygos 1.958 0.977 4.059 0.486
Lentidium.mediterraneum 9.353 0.224 0.000 0.996
Lepidochitona.cinerea 5.024 0.728 0.000 1.000
Loripes.orbiculatus 0.205 0.986 1.283 0.950
Lucinella.divaricata 5.816 0.600 0.000 1.000
Magelona.papillicornis 5.024 0.728 0.000 1.000
Maldane.glebifex 2.833 0.939 0.446 0.990
Melinna.palmata 0.261 0.986 6.839 0.200
Microdeutopus.gryllotalpa 13.341 0.044 0.870 0.984
Micromaldane.ornithochaeta 9.788 0.198 3.053 0.656
Micronephthys.stammeri 5.710 0.605 0.446 0.990
Microphthalmus.fragilis 0.234 0.986 0.467 0.989
Microphthalmus.sp. 9.420 0.219 0.000 1.000
Monocorophium.acherusicum 26.934 0.005 26.810 0.001
Mytilaster.lineatus 17.441 0.019 0.324 0.993
Mytilus.galloprovincialis 2.833 0.939 0.446 0.990
Nemertea 9.059 0.233 3.320 0.631
Nephtys.cirrosa 4.881 0.753 0.446 0.990
Nephtys.kersivalensis 2.833 0.939 0.446 0.990
Nereis.perivisceralis 5.024 0.728 0.000 1.000
Nereis.pulsatoria 0.491 0.986 0.980 0.971
Nototropis.guttatus 0.323 0.986 2.976 0.669
Oligochaeta 126.966 0.001 15.119 0.007
Paradoneis.harpagonea 2.833 0.939 0.446 0.990
Parthenina.interstincta 0.301 0.986 1.536 0.924
Parvicardium.exiguum 14.018 0.039 1.502 0.930
Perinereis.cultrifera 1.844 0.981 2.060 0.867
Perioculodes.longimanus 3.981 0.870 2.049 0.869
Phoronida 3.161 0.926 3.937 0.509
Phyllodoce.sp. 6.107 0.547 3.219 0.632
Platyhelminthes 0.644 0.986 3.118 0.642
Platynereis.dumerilii 1.824 0.981 7.414 0.173
Polititapes.aureus 2.789 0.939 2.081 0.863
Polychaeta.larvae 6.107 0.547 3.219 0.632
Polydora.ciliata 81.609 0.001 15.796 0.005
Polygordius.neapolitanus 6.107 0.547 3.219 0.632
Prionospio.cirrifera 91.317 0.001 19.403 0.002
Protodorvillea.kefersteini 0.820 0.986 4.746 0.362
Pseudocuma.longicorne 7.101 0.453 0.446 0.990
Rissoa.membranacea 50.503 0.001 0.160 0.996
Rissoa.splendida 17.291 0.019 10.624 0.047
Salvatoria.clavata 25.703 0.006 18.216 0.004
Schistomeringos.rudolphi 0.703 0.986 2.760 0.729
Sphaerosyllis.hystrix 10.217 0.179 1.307 0.949
Spio.filicornis 1.763 0.981 24.367 0.002
Spisula.subtruncata 11.731 0.089 0.000 1.000
Stenosoma.capito 1.007 0.986 4.916 0.344
Syllis.gracilis 1.598 0.981 5.347 0.283
Syllis.hyalina 3.627 0.894 0.000 0.996
Tellina.tenuis 7.795 0.377 0.446 0.990
Thracia.phaseolina 5.024 0.728 0.000 1.000
Tricolia.pullus 13.409 0.043 0.445 0.990
Tritia.neritea 1.950 0.978 1.104 0.961
Tritia.reticulata 1.128 0.983 2.531 0.777
Turbellaria 1.449 0.981 0.056 0.996
Upogebia.pusilla 8.660 0.248 0.000 1.000
lvm.clusters.zostera.33 lvm.clusters.zostera.34
LR value Pr(>LR) LR value
Abra.alba 15.271 0.010 4.994
Abra.sp. 0.000 1.000 0.000
Actiniaria 0.811 1.000 0.446
Alitta.succinea 9.839 0.093 1.072
Ampelisca.diadema 8.950 0.133 4.744
Amphibalanus.improvisus 10.321 0.082 4.259
Ampithoe.sp. 1.064 1.000 1.175
Anadara.kagoshimensis 0.811 1.000 0.446
Apherusa.bispinosa 2.197 0.995 0.000
Apseudopsis.ostroumovi 32.536 0.001 46.727
Bittium.reticulatum 10.139 0.084 0.217
Brachynotus.sexdentatus 0.236 1.000 0.446
Capitella.capitata 18.553 0.002 25.101
Capitella.minima 2.320 0.991 2.355
Chamelea.gallina 22.820 0.002 11.133
Chironomidae.larvae 0.000 1.000 7.676
Cumella.limicola 27.637 0.001 20.452
Cumella.pygmaea 4.909 0.612 0.000
Cytharella.costulata 2.833 0.963 1.046
Diogenes.pugilator 0.263 1.000 0.877
Eteone.flava 0.000 1.000 0.000
Eunice.vittata 1.873 0.999 0.483
Eurydice.dollfusi 4.909 0.612 0.000
Exogone.naidina 1.012 1.000 0.416
Gastrosaccus.sanctus 2.197 0.995 0.000
Genetyllis.tuberculata 0.063 1.000 1.888
Glycera.sp. 4.773 0.632 2.664
Glycera.tridactyla 2.652 0.977 1.471
Glycera.unicornis 0.811 1.000 0.446
Harmothoe.imbricata 0.047 1.000 1.743
Harmothoe.reticulata 4.553 0.677 0.222
Heteromastus.filiformis 0.653 1.000 5.770
Hirudinea 0.000 1.000 0.893
Hydrobia.acuta 0.845 1.000 0.467
Hydrobia.sp. 0.396 1.000 1.166
Iphinoe.tenella 0.979 1.000 2.867
Kellia.suborbicularis 4.332 0.730 1.598
Lagis.koreni 1.378 1.000 2.889
Leiochone.leiopygos 4.772 0.633 4.059
Lentidium.mediterraneum 4.394 0.718 0.000
Lepidochitona.cinerea 2.197 0.995 0.000
Loripes.orbiculatus 23.881 0.002 9.848
Lucinella.divaricata 4.958 0.603 0.000
Magelona.papillicornis 2.197 0.995 0.000
Maldane.glebifex 0.811 1.000 0.446
Melinna.palmata 11.353 0.053 6.248
Microdeutopus.gryllotalpa 0.549 1.000 10.829
Micromaldane.ornithochaeta 5.601 0.498 0.000
Micronephthys.stammeri 0.811 1.000 0.893
Microphthalmus.fragilis 0.845 1.000 0.467
Microphthalmus.sp. 6.434 0.390 10.604
Monocorophium.acherusicum 6.554 0.382 0.880
Mytilaster.lineatus 28.164 0.001 0.072
Mytilus.galloprovincialis 0.811 1.000 0.446
Nemertea 0.344 1.000 0.460
Nephtys.cirrosa 0.236 1.000 0.446
Nephtys.kersivalensis 0.811 1.000 0.446
Nereis.perivisceralis 2.197 0.995 0.000
Nereis.pulsatoria 1.766 0.999 0.980
Nototropis.guttatus 2.256 0.995 1.529
Oligochaeta 1.311 1.000 12.946
Paradoneis.harpagonea 0.811 1.000 0.446
Parthenina.interstincta 0.348 1.000 1.536
Parvicardium.exiguum 0.002 1.000 0.885
Perinereis.cultrifera 0.146 1.000 2.073
Perioculodes.longimanus 1.060 1.000 0.584
Phoronida 0.286 1.000 0.722
Phyllodoce.sp. 0.000 1.000 0.000
Platyhelminthes 1.116 1.000 3.118
Platynereis.dumerilii 0.005 1.000 1.755
Polititapes.aureus 0.920 1.000 2.081
Polychaeta.larvae 0.000 1.000 0.000
Polydora.ciliata 20.565 0.002 1.275
Polygordius.neapolitanus 0.000 1.000 0.000
Prionospio.cirrifera 31.954 0.001 0.160
Protodorvillea.kefersteini 18.752 0.002 0.636
Pseudocuma.longicorne 0.236 1.000 0.893
Rissoa.membranacea 0.416 1.000 0.818
Rissoa.splendida 4.195 0.748 16.268
Salvatoria.clavata 6.518 0.382 31.870
Schistomeringos.rudolphi 0.066 1.000 2.760
Sphaerosyllis.hystrix 8.440 0.170 5.462
Spio.filicornis 0.088 1.000 7.758
Spisula.subtruncata 4.394 0.719 3.219
Stenosoma.capito 0.492 1.000 1.211
Syllis.gracilis 0.703 1.000 3.662
Syllis.hyalina 0.000 1.000 3.584
Tellina.tenuis 1.386 1.000 0.446
Thracia.phaseolina 2.197 0.995 0.000
Tricolia.pullus 1.365 1.000 11.315
Tritia.neritea 0.205 1.000 1.104
Tritia.reticulata 0.624 1.000 0.361
Turbellaria 0.000 1.000 1.475
Upogebia.pusilla 0.000 1.000 8.030
Pr(>LR)
Abra.alba 0.596
Abra.sp. 1.000
Actiniaria 1.000
Alitta.succinea 1.000
Ampelisca.diadema 0.632
Amphibalanus.improvisus 0.702
Ampithoe.sp. 1.000
Anadara.kagoshimensis 1.000
Apherusa.bispinosa 1.000
Apseudopsis.ostroumovi 0.001
Bittium.reticulatum 1.000
Brachynotus.sexdentatus 1.000
Capitella.capitata 0.001
Capitella.minima 0.965
Chamelea.gallina 0.068
Chironomidae.larvae 0.237
Cumella.limicola 0.001
Cumella.pygmaea 1.000
Cytharella.costulata 1.000
Diogenes.pugilator 1.000
Eteone.flava 1.000
Eunice.vittata 1.000
Eurydice.dollfusi 1.000
Exogone.naidina 1.000
Gastrosaccus.sanctus 1.000
Genetyllis.tuberculata 0.988
Glycera.sp. 0.944
Glycera.tridactyla 0.997
Glycera.unicornis 1.000
Harmothoe.imbricata 0.991
Harmothoe.reticulata 1.000
Heteromastus.filiformis 0.459
Hirudinea 1.000
Hydrobia.acuta 1.000
Hydrobia.sp. 1.000
Iphinoe.tenella 0.903
Kellia.suborbicularis 0.995
Lagis.koreni 0.903
Leiochone.leiopygos 0.735
Lentidium.mediterraneum 1.000
Lepidochitona.cinerea 1.000
Loripes.orbiculatus 0.104
Lucinella.divaricata 1.000
Magelona.papillicornis 1.000
Maldane.glebifex 1.000
Melinna.palmata 0.399
Microdeutopus.gryllotalpa 0.075
Micromaldane.ornithochaeta 1.000
Micronephthys.stammeri 1.000
Microphthalmus.fragilis 1.000
Microphthalmus.sp. 0.079
Monocorophium.acherusicum 1.000
Mytilaster.lineatus 1.000
Mytilus.galloprovincialis 1.000
Nemertea 1.000
Nephtys.cirrosa 1.000
Nephtys.kersivalensis 1.000
Nereis.perivisceralis 1.000
Nereis.pulsatoria 1.000
Nototropis.guttatus 0.996
Oligochaeta 0.027
Paradoneis.harpagonea 1.000
Parthenina.interstincta 0.996
Parvicardium.exiguum 1.000
Perinereis.cultrifera 0.980
Perioculodes.longimanus 1.000
Phoronida 1.000
Phyllodoce.sp. 1.000
Platyhelminthes 0.867
Platynereis.dumerilii 0.991
Polititapes.aureus 0.979
Polychaeta.larvae 1.000
Polydora.ciliata 1.000
Polygordius.neapolitanus 1.000
Prionospio.cirrifera 1.000
Protodorvillea.kefersteini 1.000
Pseudocuma.longicorne 1.000
Rissoa.membranacea 1.000
Rissoa.splendida 0.005
Salvatoria.clavata 0.001
Schistomeringos.rudolphi 0.926
Sphaerosyllis.hystrix 0.498
Spio.filicornis 0.233
Spisula.subtruncata 0.854
Stenosoma.capito 1.000
Syllis.gracilis 0.797
Syllis.hyalina 0.797
Tellina.tenuis 1.000
Thracia.phaseolina 1.000
Tricolia.pullus 0.060
Tritia.neritea 1.000
Tritia.reticulata 1.000
Turbellaria 0.997
Upogebia.pusilla 0.216
Arguments: with 999 resampling iterations using pit.trap resampling and response assumed to be uncorrelated
Likelihood Ratio statistic: 965.7, p-value: 0.001
Univariate test statistic:
Abra.alba Abra.sp. Actiniaria Alitta.succinea Ampelisca.diadema
LR value 27.438 4.159 1.386 13.528 20.153
Pr(>LR) 0.002 0.933 0.994 0.119 0.010
Amphibalanus.improvisus Ampithoe.sp. Anadara.kagoshimensis Apherusa.bispinosa
LR value 15.231 8.727 1.386 2.773
Pr(>LR) 0.076 0.517 0.994 0.983
Apseudopsis.ostroumovi Bittium.reticulatum Brachynotus.sexdentatus
LR value 51.414 34.189 1.386
Pr(>LR) 0.001 0.001 0.994
Capitella.capitata Capitella.minima Chamelea.gallina Chironomidae.larvae
LR value 30.336 6.793 27.138 9.651
Pr(>LR) 0.002 0.718 0.002 0.396
Cumella.limicola Cumella.pygmaea Cytharella.costulata Diogenes.pugilator
LR value 33.634 6.118 3.195 2.380
Pr(>LR) 0.001 0.804 0.983 0.991
Eteone.flava Eunice.vittata Eurydice.dollfusi Exogone.naidina
LR value 4.159 3.572 6.118 7.227
Pr(>LR) 0.933 0.977 0.804 0.690
Gastrosaccus.sanctus Genetyllis.tuberculata Glycera.sp. Glycera.tridactyla
LR value 2.773 1.966 7.992 4.484
Pr(>LR) 0.983 0.994 0.575 0.925
Glycera.unicornis Harmothoe.imbricata Harmothoe.reticulata
LR value 1.386 3.192 9.416
Pr(>LR) 0.994 0.983 0.421
Heteromastus.filiformis Hirudinea Hydrobia.acuta Hydrobia.sp. Iphinoe.tenella
LR value 17.463 1.726 1.438 2.250 5.470
Pr(>LR) 0.027 0.994 0.994 0.991 0.869
Kellia.suborbicularis Lagis.koreni Leiochone.leiopygos Lentidium.mediterraneum
LR value 8.973 10.472 14.995 5.545
Pr(>LR) 0.469 0.312 0.077 0.865
Lepidochitona.cinerea Loripes.orbiculatus Lucinella.divaricata
LR value 2.773 28.176 6.172
Pr(>LR) 0.983 0.002 0.795
Magelona.papillicornis Maldane.glebifex Melinna.palmata
LR value 2.773 1.386 24.203
Pr(>LR) 0.983 0.994 0.003
Microdeutopus.gryllotalpa Micromaldane.ornithochaeta Micronephthys.stammeri
LR value 13.747 6.655 2.773
Pr(>LR) 0.113 0.721 0.983
Microphthalmus.fragilis Microphthalmus.sp. Monocorophium.acherusicum
LR value 1.437 11.855 39.678
Pr(>LR) 0.994 0.208 0.001
Mytilaster.lineatus Mytilus.galloprovincialis Nemertea Nephtys.cirrosa
LR value 34.910 1.386 4.566 1.386
Pr(>LR) 0.001 0.994 0.925 0.994
Nephtys.kersivalensis Nereis.perivisceralis Nereis.pulsatoria
LR value 1.386 2.773 2.987
Pr(>LR) 0.994 0.983 0.983
Nototropis.guttatus Oligochaeta Paradoneis.harpagonea Parthenina.interstincta
LR value 7.095 27.378 1.386 2.884
Pr(>LR) 0.690 0.002 0.994 0.983
Parvicardium.exiguum Perinereis.cultrifera Perioculodes.longimanus Phoronida
LR value 2.911 4.654 4.365 5.372
Pr(>LR) 0.983 0.925 0.925 0.879
Phyllodoce.sp. Platyhelminthes Platynereis.dumerilii Polititapes.aureus
LR value 4.159 5.906 8.537 4.065
Pr(>LR) 0.933 0.834 0.523 0.943
Polychaeta.larvae Polydora.ciliata Polygordius.neapolitanus
LR value 4.159 29.489 4.159
Pr(>LR) 0.933 0.002 0.933
Prionospio.cirrifera Protodorvillea.kefersteini Pseudocuma.longicorne
LR value 41.351 25.261 1.726
Pr(>LR) 0.001 0.002 0.994
Rissoa.membranacea Rissoa.splendida Salvatoria.clavata Schistomeringos.rudolphi
LR value 1.701 17.118 32.959 5.024
Pr(>LR) 0.994 0.032 0.001 0.900
Sphaerosyllis.hystrix Spio.filicornis Spisula.subtruncata Stenosoma.capito
LR value 12.736 34.632 5.885 7.189
Pr(>LR) 0.154 0.001 0.834 0.690
Syllis.gracilis Syllis.hyalina Tellina.tenuis Thracia.phaseolina
LR value 10.712 4.555 3.112 2.773
Pr(>LR) 0.306 0.925 0.983 0.983
Tricolia.pullus Tritia.neritea Tritia.reticulata Turbellaria Upogebia.pusilla
LR value 13.288 2.037 2.932 1.527 10.026
Pr(>LR) 0.128 0.994 0.983 0.994 0.353
Arguments:
Test statistics calculated assuming response assumed to be uncorrelated
P-value calculated using 999 resampling iterations via pit.trap resampling (to account for correlation in testing).
The factor is highly significant according to the models.
Again, save the summary for safekeeping, but also run an anova.
write_rds(glms.lvm.zostera.3.summary,
here(save.dir, "glms_lvm_zostera_3_summary.RDS"))
Run the anova on the model.
(glms.lvm.zostera.3.aov <- anova.manyglm(glms.lvm.zostera.3,
test = "LR", p.uni = "adjusted",
nBoot = 999, ## limit the number of permutations for a shorter run time
pairwise.comp = ~lvm.clusters.zostera.3, ## check the pairwise comparisons between clusters
show.time = "all")
)
Resampling begins for test 1.
Resampling run 0 finished. Time elapsed: 0.00 minutes...
Resampling run 100 finished. Time elapsed: 0.12 minutes...
Resampling run 200 finished. Time elapsed: 0.24 minutes...
Resampling run 300 finished. Time elapsed: 0.37 minutes...
Resampling run 400 finished. Time elapsed: 0.50 minutes...
Resampling run 500 finished. Time elapsed: 0.63 minutes...
Resampling run 600 finished. Time elapsed: 0.75 minutes...
Resampling run 700 finished. Time elapsed: 0.88 minutes...
Resampling run 800 finished. Time elapsed: 1.00 minutes...
Resampling run 900 finished. Time elapsed: 1.13 minutes...
Time elapsed: 0 hr 1 min 15 sec
Analysis of Deviance Table
Model: manyglm(formula = zoo.mvabnd.zostera ~ lvm.clusters.zostera.3,
Model: family = "negative.binomial")
Multivariate test:
Res.Df Df.diff Dev Pr(>Dev)
(Intercept) 31
lvm.clusters.zostera.3 28 3 965.7 0.001 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Pairwise comparison results:
Observed statistic
lvm.clusters.zostera.3:2 vs lvm.clusters.zostera.3:3 368.1
lvm.clusters.zostera.3:1 vs lvm.clusters.zostera.3:3 355.8
lvm.clusters.zostera.3:2 vs lvm.clusters.zostera.3:4 336.6
lvm.clusters.zostera.3:1 vs lvm.clusters.zostera.3:2 319.4
lvm.clusters.zostera.3:3 vs lvm.clusters.zostera.3:4 295.1
lvm.clusters.zostera.3:1 vs lvm.clusters.zostera.3:4 275.0
Free Stepdown Adjusted P-Value
lvm.clusters.zostera.3:2 vs lvm.clusters.zostera.3:3 0.007 **
lvm.clusters.zostera.3:1 vs lvm.clusters.zostera.3:3 0.007 **
lvm.clusters.zostera.3:2 vs lvm.clusters.zostera.3:4 0.010 **
lvm.clusters.zostera.3:1 vs lvm.clusters.zostera.3:2 0.010 **
lvm.clusters.zostera.3:3 vs lvm.clusters.zostera.3:4 0.010 **
lvm.clusters.zostera.3:1 vs lvm.clusters.zostera.3:4 0.010 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Univariate Tests:
Abra.alba Abra.sp. Actiniaria
Dev Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 27.438 0.002 4.159 1.000 1.386 1.000
Alitta.succinea Ampelisca.diadema
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 13.528 0.170 20.153 0.014
Amphibalanus.improvisus Ampithoe.sp.
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 15.231 0.098 8.727 0.657
Anadara.kagoshimensis Apherusa.bispinosa
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 1.386 1.000 2.773 1.000
Apseudopsis.ostroumovi Bittium.reticulatum
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 51.414 0.001 34.189 0.001
Brachynotus.sexdentatus Capitella.capitata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 1.386 1.000 30.336 0.001
Capitella.minima Chamelea.gallina
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 6.793 0.868 27.138 0.002
Chironomidae.larvae Cumella.limicola
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 9.651 0.539 33.634 0.001
Cumella.pygmaea Cytharella.costulata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 6.118 0.940 3.195 1.000
Diogenes.pugilator Eteone.flava Eunice.vittata
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
lvm.clusters.zostera.3 2.38 1.000 4.159 1.000 3.572
Eurydice.dollfusi Exogone.naidina
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 1.000 6.118 0.940 7.227 0.845
Gastrosaccus.sanctus Genetyllis.tuberculata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 2.773 1.000 1.966 1.000
Glycera.sp. Glycera.tridactyla
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 7.992 0.753 4.484 0.997
Glycera.unicornis Harmothoe.imbricata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 1.386 1.000 3.192 1.000
Harmothoe.reticulata Heteromastus.filiformis
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 9.416 0.574 17.463 0.039
Hirudinea Hydrobia.acuta Hydrobia.sp.
Dev Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 1.726 1.000 1.438 1.000 2.25 1.000
Iphinoe.tenella Kellia.suborbicularis
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 5.47 0.985 8.973 0.633
Lagis.koreni Leiochone.leiopygos
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 10.472 0.426 14.995 0.102
Lentidium.mediterraneum Lepidochitona.cinerea
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 5.545 0.978 2.773 1.000
Loripes.orbiculatus Lucinella.divaricata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 28.176 0.002 6.172 0.935
Magelona.papillicornis Maldane.glebifex
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 2.773 1.000 1.386 1.000
Melinna.palmata Microdeutopus.gryllotalpa
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 24.203 0.006 13.747 0.156
Micromaldane.ornithochaeta Micronephthys.stammeri
Dev Pr(>Dev) Dev
(Intercept)
lvm.clusters.zostera.3 6.655 0.888 2.773
Microphthalmus.fragilis Microphthalmus.sp.
Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
lvm.clusters.zostera.3 1.000 1.437 1.000 11.855
Monocorophium.acherusicum Mytilaster.lineatus
Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
lvm.clusters.zostera.3 0.280 39.678 0.001 34.91
Mytilus.galloprovincialis Nemertea
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 0.001 1.386 1.000 4.566 0.996
Nephtys.cirrosa Nephtys.kersivalensis
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 1.386 1.000 1.386 1.000
Nereis.perivisceralis Nereis.pulsatoria
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 2.773 1.000 2.987 1.000
Nototropis.guttatus Oligochaeta
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 7.095 0.848 27.378 0.002
Paradoneis.harpagonea Parthenina.interstincta
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 1.386 1.000 2.884 1.000
Parvicardium.exiguum Perinereis.cultrifera
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 2.911 1.000 4.654 0.994
Perioculodes.longimanus Phoronida
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 4.365 0.997 5.372 0.987
Phyllodoce.sp. Platyhelminthes
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 4.159 1.000 5.906 0.946
Platynereis.dumerilii Polititapes.aureus
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 8.537 0.673 4.065 1.000
Polychaeta.larvae Polydora.ciliata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 4.159 1.000 29.489 0.002
Polygordius.neapolitanus Prionospio.cirrifera
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 4.159 1.000 41.351 0.001
Protodorvillea.kefersteini Pseudocuma.longicorne
Dev Pr(>Dev) Dev
(Intercept)
lvm.clusters.zostera.3 25.261 0.006 1.726
Rissoa.membranacea Rissoa.splendida
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 1.000 1.701 1.000 17.118 0.046
Salvatoria.clavata Schistomeringos.rudolphi
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 32.959 0.001 5.024 0.990
Sphaerosyllis.hystrix Spio.filicornis
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 12.736 0.208 34.632 0.001
Spisula.subtruncata Stenosoma.capito
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 5.885 0.946 7.189 0.848
Syllis.gracilis Syllis.hyalina Tellina.tenuis
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
lvm.clusters.zostera.3 10.712 0.392 4.555 0.996 3.112
Thracia.phaseolina Tricolia.pullus
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
lvm.clusters.zostera.3 1.000 2.773 1.000 13.288 0.177
Tritia.neritea Tritia.reticulata Turbellaria
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept) <NA> <NA> <NA> <NA> <NA>
lvm.clusters.zostera.3 2.037 1.000 2.932 1.000 1.527
Upogebia.pusilla
Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA>
lvm.clusters.zostera.3 1.000 10.026 0.466
Arguments:
Test statistics calculated assuming uncorrelated response (for faster computation)
P-value calculated using 999 resampling iterations via PIT-trap resampling (to account for correlation in testing.
According to the pairwise comparison, the case 3 clusters are significantly different from one another.. apparently sufficiently so.
Save the ANOVA, too.
write_rds(glms.lvm.zostera.3.aov,
here(save.dir, "glms_lvm_zostera_3_anova.RDS"))
NOW let’s get the taxa with the highest contributions to the tested pattern.
## get the top contributing species for the initial zostera GLMs
(top.sp.glms.lvm.zostera.3 <- top_n_sp_glm(glms.lvm.zostera.3.aov, tot.dev.expl = 0.75)
)
[1] "Total deviance explained: 0.82"
Apseudopsis.ostroumovi Prionospio.cirrifera Monocorophium.acherusicum
51.413970 41.350974 39.678240
Mytilaster.lineatus Spio.filicornis Bittium.reticulatum
34.909870 34.632433 34.188511
Cumella.limicola Salvatoria.clavata Capitella.capitata
33.633823 32.958829 30.336457
Polydora.ciliata Loripes.orbiculatus Abra.alba
29.489490 28.175552 27.437828
Oligochaeta Chamelea.gallina Protodorvillea.kefersteini
27.378351 27.138297 25.260955
Melinna.palmata Ampelisca.diadema Heteromastus.filiformis
24.202974 20.153373 17.463258
Rissoa.splendida Amphibalanus.improvisus Leiochone.leiopygos
17.117581 15.231072 14.994968
Microdeutopus.gryllotalpa Alitta.succinea Tricolia.pullus
13.746930 13.527612 13.287785
Sphaerosyllis.hystrix Microphthalmus.sp. Syllis.gracilis
12.736427 11.854688 10.711746
Lagis.koreni Upogebia.pusilla Chironomidae.larvae
10.471907 10.025894 9.650905
Harmothoe.reticulata Kellia.suborbicularis Ampithoe.sp.
9.416160 8.973262 8.726571
Platynereis.dumerilii Glycera.sp. Exogone.naidina
8.536643 7.992056 7.227403
Stenosoma.capito Nototropis.guttatus Capitella.minima
7.189015 7.094867 6.793482
Micromaldane.ornithochaeta
6.655076
## unfortunately, mvabund likes to rename my species when converting the data to matrix (no spaces in names), and since I'm going to look them up in my initial untransformed count data, I have to change them back..
names(top.sp.glms.lvm.zostera.3) <- names(top.sp.glms.lvm.zostera.3) %>%
str_replace(pattern = "\\.", replacement = " ")
top.sp.glms.lvm.zostera.3
Apseudopsis ostroumovi Prionospio cirrifera Monocorophium acherusicum
51.413970 41.350974 39.678240
Mytilaster lineatus Spio filicornis Bittium reticulatum
34.909870 34.632433 34.188511
Cumella limicola Salvatoria clavata Capitella capitata
33.633823 32.958829 30.336457
Polydora ciliata Loripes orbiculatus Abra alba
29.489490 28.175552 27.437828
Oligochaeta Chamelea gallina Protodorvillea kefersteini
27.378351 27.138297 25.260955
Melinna palmata Ampelisca diadema Heteromastus filiformis
24.202974 20.153373 17.463258
Rissoa splendida Amphibalanus improvisus Leiochone leiopygos
17.117581 15.231072 14.994968
Microdeutopus gryllotalpa Alitta succinea Tricolia pullus
13.746930 13.527612 13.287785
Sphaerosyllis hystrix Microphthalmus sp. Syllis gracilis
12.736427 11.854688 10.711746
Lagis koreni Upogebia pusilla Chironomidae larvae
10.471907 10.025894 9.650905
Harmothoe reticulata Kellia suborbicularis Ampithoe sp.
9.416160 8.973262 8.726571
Platynereis dumerilii Glycera sp. Exogone naidina
8.536643 7.992056 7.227403
Stenosoma capito Nototropis guttatus Capitella minima
7.189015 7.094867 6.793482
Micromaldane ornithochaeta
6.655076
Try to plot these top contributing species - for whatever that’s worth, because 50 species on a plot is still a monstrosity.
## get the species and their abundances from the original count data, and transform them to long format
(abnd.top.sp.glms.lvm.zostera.3 <- zoo.abnd.zostera %>%
select(station, names(top.sp.glms.lvm.zostera.3)) %>%
gather(key = "species", value = "count", -station) %>%
## turn species into a factor, or you'll be very very sorry later, when they're out of order on the plot. NB need to be in REVERSE order, because ggplot plots from bottom to top, and I want the top-contributing species on top.
mutate(species = factor(species, levels = rev(names(top.sp.glms.lvm.zostera.3)))) %>%
mutate(group = factor(case_when(station %in% c("Poda", "Otmanli") ~ 1,
station == "Vromos" ~ 2,
station == "Gradina" ~ 3,
station == "Ropotamo" ~ 4)) ## add the groups
)
)
(plot.top.sp.glms.lvm.zostera.3 <- plot_top_n(abnd.top.sp.glms.lvm.zostera.3,
mapping = aes(x = species, y = log_y_min(count), colour = group),
labs.legend = paste0("group", as.character(levels(abnd.top.sp.glms.lvm.zostera.3$group))),
lab.y = "Abundance (log(y/min + 1))",
palette = "Set2"
) +
theme(legend.position = "top", legend.title = element_blank())
)
Extract the top-contributing species to each cluster (this same nightmare above, but as a table). This chunk is STILL hopelessly ugly and clumsy.
top.sp.abnd.glms.lvm.zostera.3 <- lapply(names(glms.lvm.zostera.3.summary$aliased), function(x) top_sp_glms_table(glms.lvm.zostera.3.summary, x, p = 0.05))
## fix species names (remove dot)
top.sp.abnd.glms.lvm.zostera.3 <- lapply(top.sp.abnd.glms.lvm.zostera.3, function(x) x %>% mutate(species = str_replace(species, pattern = "\\.", replacement = " ")))
## rename columns (= group names) - right now they are something like "lvm.clusters.zostera3" etc.
top.sp.abnd.glms.lvm.zostera.3 <- lapply(top.sp.abnd.glms.lvm.zostera.3, function(x) x %>% rename_at(vars(contains("lvm.clusters.zostera.3")), list(~str_replace_all(., pattern = "lvm.clusters.zostera.3", "group_"))))
top.sp.abnd.glms.lvm.zostera.3 <- lapply(top.sp.abnd.glms.lvm.zostera.3, function(x) x %>% rename_at(vars(contains("Intercept")), list(~str_replace_all(., pattern = "\\(Intercept\\)", "group_1"))))
## pull the abundances from the original count df and add to the summary glm tables
## make a long df of abundances & add clusters
zoo.abnd.zostera.long.3 <- zoo.abnd.zostera %>%
select(-c(month:replicate)) %>%
gather(key = "species", value = "count", -station) %>%
mutate(group = case_when(station %in% c("Poda", "Otmanli") ~ 1,
station == "Vromos" ~ 2,
station == "Gradina" ~ 3,
station == "Ropotamo" ~ 4)
)
## sum sp abundances by group; nest by group
zoo.abnd.zostera.long.3.smry <- zoo.abnd.zostera.long.3 %>%
group_by(species, group) %>%
summarise(total_count = sum(count)) %>%
group_by(group) %>%
nest()
## add the counts to the group dfs - wow that's an ugly, ugly hack. Wish I had more time to write this up properly..
top.sp.abnd.glms.lvm.zostera.3 <- map2(top.sp.abnd.glms.lvm.zostera.3, zoo.abnd.zostera.long.3.smry %>% pull(group), ~left_join(.x, zoo.abnd.zostera.long.3.smry %>% filter(group == .y) %>% unnest(), by = "species"))
## since these are sum counts over all the replicates (that's why the monstrous numbers), average them to be mean counts per group. NB different groups consist of different numbers of replicates, b.c. some groups consist of more than one station
(top.sp.abnd.glms.lvm.zostera.3 <- map2(top.sp.abnd.glms.lvm.zostera.3, c(16, 4, 8, 4), function(x, y) x %>% mutate(mean_count = total_count/y))
)
[[1]]
[[2]]
[[3]]
[[4]]
NA
In the case of the seagrasses and case 3 clusters, the picture is still more confusing..
The LRs seem to be a bit lower for groups 2 and 3, maybe 4 too - still not sure if you can use that as a significance measure.
For now, in group 1 (= Z1-Z2), the species/taxa with significantly higher abundance are: Bittium reticulatum, Capitella minima, Oligochaeta, Heteromastus filiformis, Polydora ciliata, Prionosprio cirrifera, Rissoa membranacea, Abra alba, Ampelisca diadema (+ others, medium abundance); and the ones with a significantly lower abundance - or even absent - S. clavata, A. ostroumovi, C. gallina, T. pullus.
There are more species singled out for this cluster, probably because of the variability between the two years of sampling.
For group 2 (= Z3), the species with higher abundance are: M. acherusicum, S. filicornis, A. diadema. The species with lower abundance - in fact 0 - are B. reticulatum, P. cirrifera, S. clavata, A. alba, P. ciliata, oligochaetes, H. filiformis, R. splendida.
For group 3 (= Z4), the species with higher abundance are: M. lineatus, less so - C. limicola, L. orbiculatus, P. kefersteini, C. capitata, etc. The species with lower abundance (or 0) are: P. cirrifera, P. ciliata, A. alba, etc.
For group 4 (= Z5), the species with higher abundance are: A. ostoumovi, C. capitata, oligochaetes (very abundant, but with a small LR - nice!). The species with lower abundance (or 0) are: R. splendida, S. clavata, C. limicola.
All in all, I think that group 1 (Poda + Otmanli) holds, and so does group 2 (Vromos). The question is whether to separate Gradina and Ropotamo into 2 groups, or if they make more sense together. Ropotamo is characterized by a very high number of oligochaetes, while Gradina’s most distinguishing characteristic is the high number of M. lineatus - mostly very small ones, attached to the rhizomes, close to the sediment surface I presume. Both stations have C. limicola in medium abundance, a species that is not present anywhere else (is it?).
Try to compare the three models..
(glms.lvm.zostera.comp <- anova(glms.lvm.zostera.1,
glms.lvm.zostera.2,
glms.lvm.zostera.3,
p.uni = "adjusted")
)
Time elapsed: 0 hr 2 min 22 sec
Analysis of Deviance Table
glms.lvm.zostera.1: zoo.mvabnd.zostera ~ lvm.clusters.zostera.1
glms.lvm.zostera.3: zoo.mvabnd.zostera ~ lvm.clusters.zostera.3
glms.lvm.zostera.2: zoo.mvabnd.zostera ~ lvm.clusters.zostera.2
Multivariate test:
Res.Df Df.diff Dev Pr(>Dev)
glms.lvm.zostera.1 29
glms.lvm.zostera.3 28 1 262.1 0.001 ***
glms.lvm.zostera.2 27 1 256.8 0.001 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Univariate Tests:
Abra.alba Abra.sp. Actiniaria
Dev Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 1.506 0.998 0 1.000 0 1.000
glms.lvm.zostera.2 0.023 1.000 0 1.000 1.386 1.000
Alitta.succinea Ampelisca.diadema
Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 4.881 0.681 0.094 1.000
glms.lvm.zostera.2 23.057 0.001 10.416 0.104
Amphibalanus.improvisus Ampithoe.sp.
Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 0.349 1.000 2.405 0.982
glms.lvm.zostera.2 8.177 0.251 3.482 0.917
Anadara.kagoshimensis Apherusa.bispinosa
Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 0 1.000 0.811 1.000
glms.lvm.zostera.2 1.386 1.000 0 1.000
Apseudopsis.ostroumovi Bittium.reticulatum
Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 20.559 0.001 3.006 0.941
glms.lvm.zostera.2 1.38 1.000 0.004 1.000
Brachynotus.sexdentatus Capitella.capitata
Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 0.811 1.000 4.124 0.814
glms.lvm.zostera.2 1.386 1.000 2.862 0.958
Capitella.minima Chamelea.gallina
Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 6.055 0.518 0.908 1.000
glms.lvm.zostera.2 0.433 1.000 1.386 0.996
Chironomidae.larvae Cumella.limicola
Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 5.456 0.615 1.089 1.000
glms.lvm.zostera.2 0 1.000 7.694 0.306
Cumella.pygmaea Cytharella.costulata
Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 1.891 0.996 0.073 1.000
glms.lvm.zostera.2 0 1.000 4.159 0.834
Diogenes.pugilator Eteone.flava Eunice.vittata
Dev Pr(>Dev) Dev Pr(>Dev) Dev
glms.lvm.zostera.1
glms.lvm.zostera.3 1.483 0.999 0 1.000 2.7
glms.lvm.zostera.2 0.68 1.000 0 1.000 0.208
Eurydice.dollfusi Exogone.naidina
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 0.959 1.891 0.996 1.284 1.000
glms.lvm.zostera.2 1.000 0 1.000 1.25 1.000
Gastrosaccus.sanctus Genetyllis.tuberculata
Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 0.811 1.000 1.499 0.998
glms.lvm.zostera.2 0 1.000 5.746 0.574
Glycera.sp. Glycera.tridactyla Glycera.unicornis
Dev Pr(>Dev) Dev Pr(>Dev) Dev
glms.lvm.zostera.1
glms.lvm.zostera.3 0 1.000 0 1.000 0
glms.lvm.zostera.2 0 1.000 1.033 1.000 1.386
Harmothoe.imbricata Harmothoe.reticulata
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 1.000 1.352 1.000 4.286 0.796
glms.lvm.zostera.2 1.000 5.561 0.595 5.794 0.566
Heteromastus.filiformis Hirudinea Hydrobia.acuta
Dev Pr(>Dev) Dev Pr(>Dev) Dev
glms.lvm.zostera.1
glms.lvm.zostera.3 7.242 0.334 0.811 1.000 0
glms.lvm.zostera.2 10.679 0.088 0 1.000 1.494
Hydrobia.sp. Iphinoe.tenella
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 1.000 0.569 1.000 1.31 1.000
glms.lvm.zostera.2 0.996 3.709 0.906 4.354 0.811
Kellia.suborbicularis Lagis.koreni
Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 4.389 0.796 0.767 1.000
glms.lvm.zostera.2 0.104 1.000 5.999 0.554
Leiochone.leiopygos Lentidium.mediterraneum
Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 8.777 0.194 1.622 0.997
glms.lvm.zostera.2 0.336 1.000 0 1.000
Lepidochitona.cinerea Loripes.orbiculatus
Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 0.811 1.000 2.917 0.948
glms.lvm.zostera.2 0 1.000 3.172 0.936
Lucinella.divaricata Magelona.papillicornis
Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 1.915 0.995 0.811 1.000
glms.lvm.zostera.2 0 1.000 0 1.000
Maldane.glebifex Melinna.palmata
Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 0 1.000 0 1.000
glms.lvm.zostera.2 1.386 0.999 2.657 0.983
Microdeutopus.gryllotalpa Micromaldane.ornithochaeta
Dev Pr(>Dev) Dev
glms.lvm.zostera.1
glms.lvm.zostera.3 10.659 0.065 2.111
glms.lvm.zostera.2 2.603 0.984 0
Micronephthys.stammeri Microphthalmus.fragilis
Pr(>Dev) Dev Pr(>Dev) Dev
glms.lvm.zostera.1
glms.lvm.zostera.3 0.995 2.197 0.994 0
glms.lvm.zostera.2 1.000 1.386 1.000 1.494
Microphthalmus.sp. Monocorophium.acherusicum
Pr(>Dev) Dev Pr(>Dev) Dev
glms.lvm.zostera.1
glms.lvm.zostera.3 1.000 2.459 0.979 1.35
glms.lvm.zostera.2 0.996 0 1.000 0.213
Mytilaster.lineatus Mytilus.galloprovincialis
Pr(>Dev) Dev Pr(>Dev) Dev
glms.lvm.zostera.1
glms.lvm.zostera.3 1.000 12.977 0.015 0
glms.lvm.zostera.2 1.000 12.953 0.038 1.386
Nemertea Nephtys.cirrosa
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 1.000 1.013 1.000 0.811 1.000
glms.lvm.zostera.2 1.000 5.479 0.634 1.386 1.000
Nephtys.kersivalensis Nereis.perivisceralis
Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 0 1.000 0.811 1.000
glms.lvm.zostera.2 1.386 1.000 0 1.000
Nereis.pulsatoria Nototropis.guttatus Oligochaeta
Dev Pr(>Dev) Dev Pr(>Dev) Dev
glms.lvm.zostera.1
glms.lvm.zostera.3 0 1.000 4.485 0.751 5.602
glms.lvm.zostera.2 3.251 0.932 0.116 1.000 9.386
Paradoneis.harpagonea Parthenina.interstincta
Pr(>Dev) Dev Pr(>Dev) Dev
glms.lvm.zostera.1
glms.lvm.zostera.3 0.607 0 1.000 0.919
glms.lvm.zostera.2 0.154 1.386 1.000 1.662
Parvicardium.exiguum Perinereis.cultrifera
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 1.000 0.824 1.000 0.973 1.000
glms.lvm.zostera.2 0.995 0.063 1.000 2.035 0.992
Perioculodes.longimanus Phoronida Phyllodoce.sp.
Dev Pr(>Dev) Dev Pr(>Dev) Dev
glms.lvm.zostera.1
glms.lvm.zostera.3 2.111 0.995 1.284 1.000 0
glms.lvm.zostera.2 0 1.000 0.11 1.000 0
Platyhelminthes Platynereis.dumerilii
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 1.000 1.372 1.000 1.257 1.000
glms.lvm.zostera.2 1.000 2.602 0.984 0.374 1.000
Polititapes.aureus Polychaeta.larvae
Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 0.751 1.000 0 1.000
glms.lvm.zostera.2 6.933 0.404 0 1.000
Polydora.ciliata Polygordius.neapolitanus
Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 13.8 0.012 0 1.000
glms.lvm.zostera.2 12.416 0.045 0 1.000
Prionospio.cirrifera Protodorvillea.kefersteini
Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 28.158 0.001 7.725 0.294
glms.lvm.zostera.2 4.922 0.749 4.879 0.749
Pseudocuma.longicorne Rissoa.membranacea
Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 0.236 1.000 1.543 0.998
glms.lvm.zostera.2 1.386 1.000 1.019 1.000
Rissoa.splendida Salvatoria.clavata
Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 5.569 0.607 15.955 0.008
glms.lvm.zostera.2 0 1.000 0 1.000
Schistomeringos.rudolphi Sphaerosyllis.hystrix
Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 2.389 0.982 0.023 1.000
glms.lvm.zostera.2 8.799 0.193 4.024 0.863
Spio.filicornis Spisula.subtruncata
Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 6.523 0.435 0 1.000
glms.lvm.zostera.2 0.246 1.000 0 1.000
Stenosoma.capito Syllis.gracilis Syllis.hyalina
Dev Pr(>Dev) Dev Pr(>Dev) Dev
glms.lvm.zostera.1
glms.lvm.zostera.3 2.178 0.994 4.755 0.707 2.507
glms.lvm.zostera.2 6.661 0.472 17.831 0.008 0
Tellina.tenuis Thracia.phaseolina
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 0.979 1.622 0.997 0.811 1.000
glms.lvm.zostera.2 1.000 1.386 1.000 0 1.000
Tricolia.pullus Tritia.neritea Tritia.reticulata
Dev Pr(>Dev) Dev Pr(>Dev) Dev
glms.lvm.zostera.1
glms.lvm.zostera.3 5.332 0.629 0.632 1.000 0
glms.lvm.zostera.2 1.38 1.000 3.479 0.917 8.301
Turbellaria Upogebia.pusilla
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
glms.lvm.zostera.1
glms.lvm.zostera.3 1.000 1.392 0.999 5.769 0.566
glms.lvm.zostera.2 0.239 1.125 1.000 0 1.000
Arguments:
Test statistics calculated assuming uncorrelated response (for faster computation)
P-value calculated using 999 resampling iterations via PIT-trap resampling (to account for correlation in testing.
Well this is tough to interpret.. Multivariate test table’s Dev is decrement from upper model, so each p-value indicates the difference between the model and upper one is statistically significant… But no info on which model represents the species matrix best.
I’ll go with the model with the lowest AIC, since there is no other objective criterion to go with.. This happens to be model 2 (groups = stations). Exactly the same result as from the classical methods.
glms.lvm.zostera.1$AICsum
[1] 6804.496
glms.lvm.zostera.2$AICsum
[1] 6661.507
glms.lvm.zostera.3$AICsum
[1] 6730.346
Now, let’s try to see a different thing - which environmental parameters best describe the species response.
I’m going to use the PCA-filtered environmental data - it’s still going to be a slog, with 7 potential predictors..
First, construct the formula for the model - will do it separately in case I need to update it later, etc.
NB there is year here - I want to try with it first!! And I don’t want the Secchi depth - it has NAs for Vromos.
(formula.env.glms.zostera <- formula(paste("zoo.mvabnd.zostera ~",
paste(env.zostera %>% select(-c(station, secchi)) %>% names(), collapse = "+")))
)
zoo.mvabnd.zostera ~ year + Ntotal + chl_a + LUSI + TOM + moisture_content +
mean_grain_size + sand + silt_clay + shoot_count + ag_biomass_wet +
bg_biomass_wet
Fit the GLMs - including all environmental parameters - to the zostera abundance data.
env.glms.zostera <- manyglm(formula.env.glms.zostera,
data = env.zostera,
family = "negative.binomial")
Explore the fit (residuals, diagnostic plots, etc.).
## residuals vs fitted values
plot(env.glms.zostera)
## all traditional (g)lm diagnostic plots
plot.manyglm(env.glms.zostera, which = 1:3)
# ### source mvabund GLM plotting functions modified to use a grey palette - I just can't redo these plots on my own, the function is doing too complicated things internally to scale the x and y axes
# source(here(functions.dir, "default.plot.manyglm_grey.R"))
# source(here(functions.dir, "plot.manyglm_grey.R"))
#
# par(mfrow = c(2,2))
# lapply(1:3, function(i) plot.manyglm.grey(glms.lvm.zostera, which = i, sub.caption = ""))
# par(mfrow = c(1, 1))
Well, it’s good enough if you ask me (still the kinda strange “line” at lin.pred = -6; otherwise residuals are random enough).
Save the model!
write_rds(env.glms.zostera,
here(save.dir, "glms_env_zostera.RDS"))
Before going off and running an ANOVA to check which predictors best explain the species abundance patterns, I’ll try to reduce the model a little - it might even improve the fit, not to mention the run time.
top.env.glm.red.zostera <- evaluate_glms_env(env.glms.zostera)
the condition has length > 1 and only the first element will be used
[1] "Best model: zoo.mvabnd.zostera ~ Ntotal + sand + shoot_count + ag_biomass_wet + bg_biomass_wet"
Check its fit.
## residuals vs fitted values
plot(top.env.glm.red.zostera)
## all traditional (g)lm diagnostic plots
plot.manyglm(top.env.glm.red.zostera, which = 1:3)
I think it’s fine; might even be better than the full model.. Save it, too.
write_rds(top.env.glm.red.zostera,
here(save.dir, "glms_top_env_red_zostera.RDS"))
Run ANOVA on this model.
(top.env.glm.red.zostera.aov <- anova.manyglm(top.env.glm.red.zostera,
test = "LR", p.uni = "adjusted",
nBoot = 999, ## limit the number of permutations for a shorter run time
show.time = "all")
)
Resampling begins for test 1.
Resampling run 0 finished. Time elapsed: 0.00 minutes...
Resampling run 100 finished. Time elapsed: 0.13 minutes...
Resampling run 200 finished. Time elapsed: 0.26 minutes...
Resampling run 300 finished. Time elapsed: 0.39 minutes...
Resampling run 400 finished. Time elapsed: 0.53 minutes...
Resampling run 500 finished. Time elapsed: 0.66 minutes...
Resampling run 600 finished. Time elapsed: 0.79 minutes...
Resampling run 700 finished. Time elapsed: 0.92 minutes...
Resampling run 800 finished. Time elapsed: 1.05 minutes...
Resampling run 900 finished. Time elapsed: 1.18 minutes...
Resampling begins for test 2.
Resampling run 0 finished. Time elapsed: 0.00 minutes...
Resampling run 100 finished. Time elapsed: 0.14 minutes...
Resampling run 200 finished. Time elapsed: 0.28 minutes...
Resampling run 300 finished. Time elapsed: 0.43 minutes...
Resampling run 400 finished. Time elapsed: 0.57 minutes...
Resampling run 500 finished. Time elapsed: 0.71 minutes...
Resampling run 600 finished. Time elapsed: 0.87 minutes...
Resampling run 700 finished. Time elapsed: 1.02 minutes...
Resampling run 800 finished. Time elapsed: 1.16 minutes...
Resampling run 900 finished. Time elapsed: 1.31 minutes...
Resampling begins for test 3.
Resampling run 0 finished. Time elapsed: 0.00 minutes...
Resampling run 100 finished. Time elapsed: 0.15 minutes...
Resampling run 200 finished. Time elapsed: 0.29 minutes...
Resampling run 300 finished. Time elapsed: 0.43 minutes...
Resampling run 400 finished. Time elapsed: 0.56 minutes...
Resampling run 500 finished. Time elapsed: 0.70 minutes...
Resampling run 600 finished. Time elapsed: 0.85 minutes...
Resampling run 700 finished. Time elapsed: 0.99 minutes...
Resampling run 800 finished. Time elapsed: 1.13 minutes...
Resampling run 900 finished. Time elapsed: 1.27 minutes...
Resampling begins for test 4.
Resampling run 0 finished. Time elapsed: 0.00 minutes...
Resampling run 100 finished. Time elapsed: 0.14 minutes...
Resampling run 200 finished. Time elapsed: 0.27 minutes...
Resampling run 300 finished. Time elapsed: 0.42 minutes...
Resampling run 400 finished. Time elapsed: 0.55 minutes...
Resampling run 500 finished. Time elapsed: 0.69 minutes...
Resampling run 600 finished. Time elapsed: 0.83 minutes...
Resampling run 700 finished. Time elapsed: 0.96 minutes...
Resampling run 800 finished. Time elapsed: 1.09 minutes...
Resampling run 900 finished. Time elapsed: 1.22 minutes...
Resampling begins for test 5.
Resampling run 0 finished. Time elapsed: 0.00 minutes...
Resampling run 100 finished. Time elapsed: 0.12 minutes...
Resampling run 200 finished. Time elapsed: 0.25 minutes...
Resampling run 300 finished. Time elapsed: 0.37 minutes...
Resampling run 400 finished. Time elapsed: 0.50 minutes...
Resampling run 500 finished. Time elapsed: 0.62 minutes...
Resampling run 600 finished. Time elapsed: 0.74 minutes...
Resampling run 700 finished. Time elapsed: 0.86 minutes...
Resampling run 800 finished. Time elapsed: 0.98 minutes...
Resampling run 900 finished. Time elapsed: 1.11 minutes...
Time elapsed: 0 hr 6 min 45 sec
Analysis of Deviance Table
Model: manyglm(formula = zoo.mvabnd.zostera ~ Ntotal + sand + shoot_count +
Model: ag_biomass_wet + bg_biomass_wet, family = "negative.binomial",
Model: data = env.zostera)
Multivariate test:
Res.Df Df.diff Dev Pr(>Dev)
(Intercept) 31
Ntotal 30 1 299.7 0.001 ***
sand 29 1 272.1 0.001 ***
shoot_count 28 1 355.3 0.001 ***
ag_biomass_wet 27 1 235.2 0.001 ***
bg_biomass_wet 26 1 424.9 0.001 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Univariate Tests:
Abra.alba Abra.sp. Actiniaria Alitta.succinea
Dev Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
Ntotal 6.177 0.545 4.157 0.945 1.004 1.000 19.751
sand 19.42 0.004 0 1.000 0.412 1.000 0.204
shoot_count 0.506 1.000 0.002 1.000 2.581 0.999 1.336
Ampelisca.diadema Amphibalanus.improvisus
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
Ntotal 0.003 5.846 0.578 10.874 0.057
sand 1.000 25.503 0.002 1.185 1.000
shoot_count 1.000 27.113 0.001 0.224 1.000
Ampithoe.sp. Anadara.kagoshimensis Apherusa.bispinosa
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
Ntotal 10.408 0.080 1.004 0.999 0.83
sand 1.162 1.000 0.381 1.000 3.329
shoot_count 0.23 1.000 2.765 0.995 0
Apseudopsis.ostroumovi Bittium.reticulatum
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
Ntotal 1.000 5.466 0.634 1.145 0.999
sand 0.981 5.211 0.802 0.291 1.000
shoot_count 1.000 10.604 0.169 18.053 0.006
Brachynotus.sexdentatus Capitella.capitata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
Ntotal 0.004 1.000 1.871 0.998
sand 0.202 1.000 1.595 0.999
shoot_count 0.445 1.000 15.66 0.019
Capitella.minima Chamelea.gallina Chironomidae.larvae
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
Ntotal 1.126 0.999 0.789 1.000 9.648
sand 0.223 1.000 3.252 0.986 0
shoot_count 20.087 0.003 12.142 0.098 0.001
Cumella.limicola Cumella.pygmaea
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
Ntotal 0.162 0.501 1.000 2.1 0.996
sand 1.000 2.908 0.992 7.78 0.433
shoot_count 1.000 3.986 0.934 0.001 1.000
Cytharella.costulata Diogenes.pugilator Eteone.flava
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
Ntotal 0.849 1.000 0.003 1.000 4.157
sand 0.163 1.000 0.317 1.000 0
shoot_count 0.48 1.000 6.108 0.672 0.002
Eunice.vittata Eurydice.dollfusi
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
Ntotal 0.940 3.083 0.990 2.1 0.996
sand 1.000 3.191 0.988 7.638 0.449
shoot_count 1.000 0.665 1.000 0.142 1.000
Exogone.naidina Gastrosaccus.sanctus
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
Ntotal 7.771 0.381 0.83 1.000
sand 3.266 0.986 3.329 0.976
shoot_count 0.698 1.000 0 1.000
Genetyllis.tuberculata Glycera.sp. Glycera.tridactyla
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
Ntotal 1.232 0.999 1.097 0.999 0.066
sand 6.164 0.679 4.521 0.887 2.045
shoot_count 3.149 0.976 0.675 1.000 8.534
Glycera.unicornis Harmothoe.imbricata
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
Ntotal 1.000 1.004 1.000 0.915 1.000
sand 0.999 0.381 1.000 6.699 0.595
shoot_count 0.342 2.765 0.996 10.277 0.192
Harmothoe.reticulata Heteromastus.filiformis Hirudinea
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
Ntotal 2.036 0.997 2.133 0.996 0
sand 8.582 0.320 4.357 0.912 0.091
shoot_count 0.077 1.000 1.732 1.000 0.014
Hydrobia.acuta Hydrobia.sp. Iphinoe.tenella
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
Ntotal 1.000 1.425 0.999 1.301 0.999 0.144
sand 1.000 0.408 1.000 0.215 1.000 3.241
shoot_count 1.000 2.507 0.999 0.013 1.000 0.005
Kellia.suborbicularis Lagis.koreni
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
Ntotal 1.000 2.726 0.990 0 1.000
sand 0.986 1.702 0.999 2.559 0.996
shoot_count 1.000 8.058 0.409 11.219 0.140
Leiochone.leiopygos Lentidium.mediterraneum
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
Ntotal 2.493 0.992 1.659 0.999
sand 1.08 1.000 6.526 0.645
shoot_count 7.538 0.473 0.131 1.000
Lepidochitona.cinerea Loripes.orbiculatus
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
Ntotal 0.83 1.000 1.634 0.999
sand 3.215 0.988 1.236 1.000
shoot_count 0.113 1.000 22.136 0.001
Lucinella.divaricata Magelona.papillicornis
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
Ntotal 2.519 0.992 0.83 1.000
sand 0.005 1.000 3.215 0.988
shoot_count 3.884 0.942 0.113 1.000
Maldane.glebifex Melinna.palmata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
Ntotal 1.004 0.999 3.974 0.966
sand 0.412 1.000 1.826 0.999
shoot_count 2.581 0.999 5.31 0.810
Microdeutopus.gryllotalpa Micromaldane.ornithochaeta
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
Ntotal 5.334 0.664 4.195 0.900
sand 1.148 1.000 6.449 0.655
shoot_count 3.03 0.981 0 1.000
Micronephthys.stammeri Microphthalmus.fragilis
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
Ntotal 3.828 0.970 0.03 1.000
sand 0.614 1.000 1.905 0.999
shoot_count 1.079 1.000 2.619 0.998
Microphthalmus.sp. Monocorophium.acherusicum
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
Ntotal 1.497 0.999 14.561 0.019
sand 0.028 1.000 0.234 1.000
shoot_count 4.309 0.932 18.824 0.005
Mytilaster.lineatus Mytilus.galloprovincialis Nemertea
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
Ntotal 15.75 0.012 1.004 0.999 0.617
sand 1.073 1.000 0.381 1.000 0.254
shoot_count 5.489 0.792 2.765 0.995 9.1
Nephtys.cirrosa Nephtys.kersivalensis
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
Ntotal 1.000 0.458 1.000 1.004 1.000
sand 1.000 0.059 1.000 0.381 1.000
shoot_count 0.288 1.444 1.000 2.765 0.996
Nereis.perivisceralis Nereis.pulsatoria
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
Ntotal 0.83 1.000 2.909 0.990
sand 3.329 0.976 0.077 1.000
shoot_count 0 1.000 0.002 1.000
Nototropis.guttatus Oligochaeta Paradoneis.harpagonea
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept)
Ntotal 4.526 0.882 5.007 0.722 1.004
sand 1.555 0.999 1.836 0.999 0.412
shoot_count 4.117 0.932 12.359 0.089 2.581
Parthenina.interstincta Parvicardium.exiguum
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept)
Ntotal 1.000 1.009 0.999 2.023 0.997
sand 1.000 0.001 1.000 0.537 1.000
shoot_count 0.999 10.718 0.169 2.433 0.999
Perinereis.cultrifera Perioculodes.longimanus Phoronida
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept) <NA> <NA> <NA> <NA> <NA>
Ntotal 2.475 0.992 0.055 1.000 0.004
sand 1.989 0.999 0.003 1.000 2.218
shoot_count 0.04 1.000 5.602 0.769 4.34
Phyllodoce.sp. Platyhelminthes
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA> <NA>
Ntotal 1.000 4.157 0.940 1.998 0.997
sand 0.998 0 1.000 0 1.000
shoot_count 0.928 0.002 1.000 0.742 1.000
Platynereis.dumerilii Polititapes.aureus
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA>
Ntotal 1.236 0.999 0.241 1.000
sand 0.216 1.000 6.606 0.624
shoot_count 6.46 0.620 1.073 1.000
Polychaeta.larvae Polydora.ciliata
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA>
Ntotal 4.157 0.937 25.833 0.001
sand 0 1.000 10.787 0.131
shoot_count 0.002 1.000 4.281 0.932
Polygordius.neapolitanus Prionospio.cirrifera
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA>
Ntotal 4.157 0.937 3.887 0.967
sand 0 1.000 48.848 0.001
shoot_count 0.002 1.000 0.005 1.000
Protodorvillea.kefersteini Pseudocuma.longicorne
Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA>
Ntotal 5.159 0.708 0.884 1.000
sand 0.994 1.000 2.017 0.999
shoot_count 0.73 1.000 0.192 1.000
Rissoa.membranacea Rissoa.splendida Salvatoria.clavata
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept) <NA> <NA> <NA> <NA> <NA>
Ntotal 2.146 0.996 0.416 1.000 1.798
sand 3.924 0.953 3.515 0.964 2.994
shoot_count 0.204 1.000 1.17 1.000 0.118
Schistomeringos.rudolphi Sphaerosyllis.hystrix
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA> <NA>
Ntotal 0.999 1.251 0.999 0.109 1.000
sand 0.991 1.657 0.999 0.151 1.000
shoot_count 1.000 9.19 0.284 10.018 0.223
Spio.filicornis Spisula.subtruncata Stenosoma.capito
Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept) <NA> <NA> <NA> <NA> <NA>
Ntotal 17.283 0.007 0.014 1.000 1.53
sand 0.075 1.000 0.081 1.000 4.409
shoot_count 5.161 0.847 3.58 0.961 0.02
Syllis.gracilis Syllis.hyalina Tellina.tenuis
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev) Dev
(Intercept) <NA> <NA> <NA> <NA> <NA> <NA>
Ntotal 0.999 3.343 0.986 4.551 0.882 1.144
sand 0.901 0.432 1.000 0 1.000 1.096
shoot_count 1.000 1.132 1.000 0.001 1.000 2.189
Thracia.phaseolina Tricolia.pullus
Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA> <NA>
Ntotal 0.999 0.83 1.000 3.903 0.967
sand 1.000 3.329 0.981 0.445 1.000
shoot_count 0.999 0 1.000 0.012 1.000
Tritia.neritea Tritia.reticulata Turbellaria
Dev Pr(>Dev) Dev Pr(>Dev) Dev Pr(>Dev)
(Intercept) <NA> <NA> <NA> <NA> <NA> <NA>
Ntotal 0.972 1.000 0.049 1.000 0.01 1.000
sand 0.698 1.000 5.174 0.808 0.763 1.000
shoot_count 0.444 1.000 0.182 1.000 0.158 1.000
Upogebia.pusilla
Dev Pr(>Dev)
(Intercept) <NA> <NA>
Ntotal 10.023 0.128
sand 0 1.000
shoot_count 0.001 1.000
[ reached getOption("max.print") -- omitted 2 rows ]
Arguments:
Test statistics calculated assuming uncorrelated response (for faster computation)
P-value calculated using 999 resampling iterations via PIT-trap resampling (to account for correlation in testing.
Nice, all terms are significant now! Again, as with the sand samples, there is one eutrophication term + one sediment composition + seagrass parameters. Seems reasonable enough.
Save this ANOVA (takes too long to run anew).
write_rds(top.env.glm.red.zostera.aov,
here(save.dir, "glms_top_env_red_zostera_anova.RDS"))
Get the taxa with the highest contributions to the tested pattern (here - species most affected by changes in water/environmental quality parameters).
## get the top contributing species for the environmental parameter zostera GLMs
(top.sp.glms.env.red.zostera <- top_n_sp_glm(top.env.glm.red.zostera.aov, tot.dev.expl = 0.75)
)
[1] "Total deviance explained: 0.771"
Polydora.ciliata Alitta.succinea Spio.filicornis
25.833258 19.750751 17.282878
Mytilaster.lineatus Monocorophium.acherusicum Amphibalanus.improvisus
15.750298 14.561059 10.874348
Ampithoe.sp. Upogebia.pusilla Chironomidae.larvae
10.407890 10.022548 9.647785
Exogone.naidina Abra.alba Ampelisca.diadema
7.770666 6.177181 5.846268
Apseudopsis.ostroumovi Microdeutopus.gryllotalpa Protodorvillea.kefersteini
5.466183 5.334367 5.159364
Oligochaeta Syllis.hyalina Nototropis.guttatus
5.007334 4.551098 4.525633
Micromaldane.ornithochaeta Polychaeta.larvae Polygordius.neapolitanus
4.195233 4.157056 4.157056
Eteone.flava Phyllodoce.sp. Abra.sp.
4.157056 4.157056 4.157056
Melinna.palmata Tricolia.pullus Prionospio.cirrifera
3.974488 3.902948 3.886516
Micronephthys.stammeri Syllis.gracilis Eunice.vittata
3.827638 3.343254 3.082611
## unfortunately, mvabund likes to rename my species when converting the data to matrix (no spaces in names), and since I'm going to look them up in my initial untransformed count data, I have to change them back.. DON'T BE IN A HURRY TO DO THAT IF YOU WANT TO SUBSET THE ORIGINAL MATRIX BEFORE RUNNING TRAITGLM
names(top.sp.glms.env.red.zostera) <- names(top.sp.glms.env.red.zostera) %>%
str_replace(pattern = "\\.", replacement = " ")
I’m going to plot these top contributing species, but I’m not using the plot. At least this time it’s more manageable, but still not presentable enough..
## get the species and their abundances from the original count data, and transform them to long format
(abnd.top.sp.glms.env.red.zostera <- zoo.abnd.zostera %>%
select(station, names(top.sp.glms.env.red.zostera)) %>%
gather(key = "species", value = "count", -station) %>%
## turn species into a factor, or you'll be very very sorry later, when they're out of order on the plot. NB need to be in REVERSE order, because ggplot plots from bottom to top, and I want the top-contributing species on top.
mutate(species = factor(species, levels = rev(names(top.sp.glms.env.red.zostera)))) %>%
## add clusters from LVM as a column
mutate(group = case_when(station == "Poda" ~ 1,
station == "Otmanli" ~ 2,
station == "Vromos" ~ 3,
station == "Gradina" ~ 4,
station == "Ropotamo" ~ 5))
)
(plot.top.sp.glms.env.red.zostera <- plot_top_n(abnd.top.sp.glms.env.red.zostera,
mapping = aes(x = species, y = log_y_min(count), colour = factor(group)),
labs.legend = unique(abnd.top.sp.glms.env.red.zostera$group),
lab.y = "Abundance (log(y/min + 1))",
palette = "Set2"
) +
theme(legend.position = "top")
)
Extract the taxon information (univariate tests) from the model ANOVA to present as a table (probably better than this plot, although it’s informative).
## extract the univariate test coefficients (LR) from the environmental model ANOVA. NB keep the row names when converting the matrix to tibble!
table.top.sp.glms.env.red.zostera <- as_tibble(top.env.glm.red.zostera.aov$uni.test, rownames = "var")
## fix the species names - remove first dor
names(table.top.sp.glms.env.red.zostera) <- names(table.top.sp.glms.env.red.zostera) %>%
str_replace(pattern = "\\.", replacement = " ")
## subset only the top species (explaining ~75% of the dataset variation)
table.top.sp.glms.env.red.zostera <- table.top.sp.glms.env.red.zostera %>%
select(var, names(top.sp.glms.env.red.zostera))
## transpose, because a table with 50 columns is just unreadable
(table.top.sp.glms.env.red.zostera <- table.top.sp.glms.env.red.zostera %>%
gather(key = species, value = value, -var) %>%
spread(key = var, value = value) %>%
## arrange as before (terms in the order they appear in the model, and by descending value of the LR for the first model term - here, PO4). Also get rid of the intercept (it's all-NA anyway).
select(species, Ntotal, sand, shoot_count, ag_biomass_wet, bg_biomass_wet) %>%
arrange(desc(Ntotal))
)
Save this to a file - will have to format it as a nice table by hand, unfortunately.
write_csv(table.top.sp.glms.env.red.zostera,
here(save.dir, "taxa_contrib_glms_top_env_red_zostera.csv"))
Calculate the percentage contribution of each of these species to each of the model terms (Dev(term) = Sum-of-LR - sum of the LRs for the individual univariate species tests)..
## get the total deviance (Sum-of-LR) for each model term
(dev.terms.top.glms.env.zostera <- as_tibble(top.env.glm.red.zostera.aov$table, rownames = "var") %>%
## get rid of unnecessary variables (I only want the deviance value for each term) and intercept term
select(var, Dev) %>%
filter(var != "(Intercept)") %>%
## transpose
gather(variable, value, -var) %>%
spread(var, value) %>%
## get rid of first column and rearrange columns to match table of deviances of univariate tests for species
select(-variable) %>%
select(Ntotal, sand, shoot_count, ag_biomass_wet, bg_biomass_wet)
)
## calculate the proportion contribution of each species to each parameter deviance
prop.top.sp.glms.env.red.zostera <- map2_df(table.top.sp.glms.env.red.zostera %>% select(-species),
dev.terms.top.glms.env.zostera,
~.x/.y)
## add back the species
(prop.top.sp.glms.env.red.zostera <- bind_cols(table.top.sp.glms.env.red.zostera %>% select(species),
prop.top.sp.glms.env.red.zostera)
)
I’ll do the pseudo-traits analysis - fit single predictive model for all species at all sites, but w/o attempting to explain the different responses using traits - the species ID is used in place of a traits matrix), although I don’t think it will amount to anything useful.
NB only use the top species that exhibited a reaction in the environmental model fit (= the ones accounting for ~75% of the total variability), and only the significant predictors - to improve run times.
sp.response.glms.env.red.zostera <- traitglm(L = mvabund(zoo.abnd.flt.zostera[, names(top.sp.glms.env.red.zostera)]),
R = as.matrix(env.zostera %>% select(Ntotal, sand, shoot_count, ag_biomass_wet, bg_biomass_wet)),
method = "manyglm")
No traits matrix entered, so will fit SDMs with different env response for each spp
sp.response.glms.env.red.zostera$fourth.corner
Ntotal sand shoot_count ag_biomass_wet
names.L.Abra.sp. -0.47066762 0.8734886154 0.46922359 -0.19993821
names.L.Alitta.succinea 0.97052617 0.9239972975 0.15761977 0.34540391
names.L.Ampelisca.diadema 0.07926714 0.4982502059 0.08427469 0.04139468
names.L.Amphibalanus.improvisus 0.01579908 0.1367386026 0.02102261 -0.02672181
names.L.Ampithoe.sp. -0.23185028 0.9766780527 -0.86628249 -0.74571356
names.L.Apseudopsis.ostroumovi 1.64548321 -1.0408187107 -1.81840977 0.56715226
names.L.Chironomidae.larvae 1.31227261 0.1002162364 0.12598021 0.05010550
names.L.Eteone.flava -0.47066762 0.8734886147 0.46922359 -0.19993821
names.L.Eunice.vittata -0.80681453 -1.1651097143 0.87652213 0.87742696
names.L.Exogone.naidina -2.71929348 -1.2204528999 0.50458742 0.72444467
names.L.Melinna.palmata -0.60638932 0.1355595122 0.47942801 -0.75972197
names.L.Microdeutopus.gryllotalpa -0.06793176 0.1548066634 0.05529672 0.15492252
names.L.Micromaldane.ornithochaeta -0.03794287 1.1454709967 0.21794177 -0.18913046
names.L.Micronephthys.stammeri -0.27494238 -0.3866591307 0.52525177 1.09138609
names.L.Monocorophium.acherusicum -0.17196470 0.2856739339 0.13559306 -0.02596581
names.L.Mytilaster.lineatus -0.12863711 0.0415408498 -0.21351554 0.13096055
names.L.Nototropis.guttatus -3.39299319 -2.6671597928 1.95831019 2.81907411
names.L.Oligochaeta 0.24580986 0.0008031048 -0.27535910 0.05999869
names.L.Phyllodoce.sp. -0.47066762 0.8734886150 0.46922359 -0.19993821
names.L.Polychaeta.larvae -0.47066762 0.8734886136 0.46922359 -0.19993820
names.L.Polydora.ciliata 0.08423213 0.0097291405 0.15937837 0.02005751
names.L.Polygordius.neapolitanus -0.47066762 0.8734886143 0.46922359 -0.19993821
names.L.Prionospio.cirrifera 0.88939049 -0.8247531556 -0.04010420 -0.33490099
names.L.Protodorvillea.kefersteini -2.59810569 -2.3545060528 0.75998659 2.29012099
names.L.Spio.filicornis -0.38562919 0.2369199100 0.06576463 -0.07758304
names.L.Syllis.gracilis 0.70617192 -1.4267780844 -1.03624608 0.23992203
names.L.Syllis.hyalina 1.41675539 0.0868009271 0.13451699 0.04413407
names.L.Tricolia.pullus -0.66341187 -2.5031380589 -0.53076627 1.42443911
names.L.Upogebia.pusilla 1.37595789 0.0920536483 0.13121625 0.04647257
bg_biomass_wet
names.L.Abra.sp. -0.25357886
names.L.Alitta.succinea -0.76895635
names.L.Ampelisca.diadema 0.18259939
names.L.Amphibalanus.improvisus -0.23201790
names.L.Ampithoe.sp. 0.03055559
names.L.Apseudopsis.ostroumovi 1.74812763
names.L.Chironomidae.larvae 1.03836845
names.L.Eteone.flava -0.25357886
names.L.Eunice.vittata 0.52390238
names.L.Exogone.naidina 0.09265243
names.L.Melinna.palmata -1.53484185
names.L.Microdeutopus.gryllotalpa 0.19540154
names.L.Micromaldane.ornithochaeta 0.50432844
names.L.Micronephthys.stammeri 0.19869790
names.L.Monocorophium.acherusicum 0.03209065
names.L.Mytilaster.lineatus 0.41368623
names.L.Nototropis.guttatus 1.74403783
names.L.Oligochaeta 0.37862412
names.L.Phyllodoce.sp. -0.25357886
names.L.Polychaeta.larvae -0.25357886
names.L.Polydora.ciliata -0.18809997
names.L.Polygordius.neapolitanus -0.25357886
names.L.Prionospio.cirrifera -0.11604329
names.L.Protodorvillea.kefersteini 1.48926441
names.L.Spio.filicornis -0.32857846
names.L.Syllis.gracilis 1.78601308
names.L.Syllis.hyalina 1.10641092
names.L.Tricolia.pullus 2.08730622
names.L.Upogebia.pusilla 1.07984888
# plot this
a.z <- max(abs(sp.response.glms.env.red.zostera$fourth.corner))
colort <- colorRampPalette(c("blue","white","red"))
plot.spp.z <- lattice::levelplot(t(as.matrix(sp.response.glms.env.red.zostera$fourth.corner)), xlab = "Environmental Variables",
ylab = "Species", col.regions = colort(100), at = seq(-a.z, a.z, length = 100),
scales = list(x = list(rot = 45)))
print(plot.spp.z)
Here at least the directions are a little more coherent than the environmental parameters for the sand stations (seagrass biomasses more or less in the same direction, etc.). The below-ground biomass exerts more pronounced influence on the specific abundances - normal, since most of these are infauna.